[Lazarus] Dynamic creation of TTrackBar

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Dec 17 17:10:30 CET 2009


On Thu, 17 Dec 2009 23:58:59 +0800
Brad Campbell <brad at wasp.net.au> wrote:

> Mattias Gaertner wrote:
> > On Thu, 17 Dec 2009 23:37:21 +0800
> > Brad Campbell <brad at wasp.net.au> wrote:
> > 
> >> G'day all,
> >>
> >> I'm currently using "Lazarus 0.9.29 r22679 FPC 2.2.5 i386-linux-gtk 2 (beta)".
> >>
> >> On a form, I'm creating 30-40 instances of a TTrackBar dynamically. If, at design time I have a 
> >> TTrackBar on the form, this all goes swimingly. If, however there is no TTrackBar on the form, when 
> >> I run the application I get "Class "TTrackBar" not found.".
> > 
> > How do you create the TTrackBars?
> > 
> 
> Sorry about that.
> 
> Var
> 	Fred : Array[0..15] of TTrackBar;
> 
> Procedure Doit;
> Var
>    I : Integer;
> Begin
>    For I := 0 to 15 do
>      Begin
>      Fred[I] := TTrackBar.Create(Form1);
>      Fred[I].Parent := Form1;
>      End;
> End;

Add unit comctrls to uses clauses.

Mattias




More information about the Lazarus mailing list