Tricks

Delphi programming : How do create a VCL in run time ?

Please see below code :
for example TLabel :

function make_label(Lparent:Twincontrol;LLeft:integer;LTop:integer;LCaption:TCaption) :TLabel;
  Var    
    MyLable : TControl;  
  Begin    
    MyLable:=Tlabel.Create(nil);  
    Tlabel (Mylable).Parent:=Lparent;  
    Tlabel (Mylable).Left:=LLeft;  
    Tlabel (Mylable).Top:=LTop;  
    Tlabel (Mylable).Caption:=LCaption;  
    make_label:=Tlabel (Mylable);  
  End;    

[ 26 Oct,2003 ]

Archive

Back
AHW