Jump to content

Runtime scrollbox resizing


bbosnjak

Recommended Posts

I have a TUnimPanel inside a TUnimScrollBox.

 

I don't know what height the panel needs to be at design time, so at runtime I need to set the panel height accordingly.

 

The result at runtime is that the panel's height changes correctly, but the scroll box maintains its original scroll range.  As a result, I can't scroll down to the bottom of the panel.

 

What's the February 2017 solution to this old problem (the old solutions aren't working for me :-( )?

Link to comment
Share on other sites

Hi,

 

Can you try this approach for now?

 

For example:

procedure TMainmForm.UnimButton1Click(Sender: TObject);
var
  dHeight: Integer;
  scrollJSName: string;
begin
  dHeight := 400;
  UnimPanel1.Height := UnimPanel1.Height + dHeight;
  scrollJSName := UnimScrollBox1.JSName;
  UniSession.AddJS('var me='+scrollJSName+'.scrollableBehavior.scrollView.getScroller(); me.maxPosition.y+='+IntToStr(dHeight));
end;

Best regards.

Link to comment
Share on other sites

×
×
  • Create New...