freepascal - Is there a delphi ScrollInView equivalent in Free Pascal? -


i have scrollbox , i'm adding controls @ runtime. however, when controls exceed scrollbox height, want scrollbox scroll way bottom newly added controls visible.

doing research, i've found called "scrollinview" delphi. seeing how many (quite lot) of delphi methods/functions available in free pascal, know of equivalent particular one? if not, can me achieve goal (auto-scrolling scrollbox bottom) different solution?

thanks in advance,

oscar

something this?

procedure tform1.button1click(sender: tobject); begin     tedit.create(self)     begin         parent := scrollbox1;         left := 10;         top := scrollbox1.controlcount * 40;         scrollbox1.vertscrollbar.position := top;     end; end; 

and here hte simple implementation of scrollinview method:

tscrollboxhelper = class helper tscrollbox     procedure scrollinview(acontrol: tcontrol); end;  implementation  procedure tscrollboxhelper.scrollinview(acontrol: tcontrol); begin     if acontrol.parent = self     begin         self.vertscrollbar.position := acontrol.top;         self.horzscrollbar.position := acontrol.left;     end; end; 

usage:

procedure tform1.button2click(sender: tobject); begin     scrollbox1.scrollinview(scrollbox1.controls[3]); end; 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -