Board index » cppbuilder » TLabels inside a TScrollBox at runtime

TLabels inside a TScrollBox at runtime

How do I create TLabels inside of a TScrollBox at runtime? The TScrollBox is
created at design time (well, not necessarily...) and the TLabels at
runtime.

--
Christian Davn
cy...@home.se
http://cyner.cjb.net

   "When I hear somebody sigh,
    'Life is hard' I am always
    tempted to ask, 'Compared to what?'"

 

Re:TLabels inside a TScrollBox at runtime


Quote
Stefan Hoffmeister (TeamB) wrote:
> : "c h r i s t i a n" <cy...@no.spam.home.se> wrote:

> >How do I create TLabels inside of a TScrollBox at runtime?

> Create the labels dynamically

>   YourLabel = new TLabel(NULL);
>   YourLabel->Top = 10;
>   YourLabel->Left = 10;

> and - very important - make the scroll box the "visual parent" of the
> control:

>   YourLabel->Parent = YourScrollBox;

Thanks! You actually answered my question in less than five minutes! That's
great!

--
Christian Davn
cy...@home.se
http://cyner.cjb.net

   "When I hear somebody sigh,
    'Life is hard' I am always
    tempted to ask, 'Compared to what?'"

Re:TLabels inside a TScrollBox at runtime


: "c h r i s t i a n" <cy...@no.spam.home.se> wrote:

Quote
>How do I create TLabels inside of a TScrollBox at runtime?

Create the labels dynamically

  YourLabel = new TLabel(NULL);
  YourLabel->Top = 10;
  YourLabel->Left = 10;

and - very important - make the scroll box the "visual parent" of the
control:

  YourLabel->Parent = YourScrollBox;

--
General information:
  * Post to the right group - http://www.borland.com/newsgroups/
    * Do not cross- or multipost
      * Research at http://www.mers.com/searchsite.html

Stefan Hoffmeister - http://www.econos.de/
TeamB - http://www.teamb.com/

Other Threads