list - How to dynamically make multiple Labels, Edits and etc. in Delphi? -
i want users create own list of controls such tedit
, tcheckbox
, tlabel
, , other things. how can make another, when have predefine every control, don't know how many objects define?
this should create each object knowing class type:
var obj:tcontrol; begin obj := tedit.create(aowner); obj begin //set properties here... ... parent := self; //assuming you're writing code in form class. if not, use object variable pointing form instead of `self` end; end;
to store unknown number of objects, can either use dynamic array, or link list, or can use controls
property of form.
this start of want (basics). have plenty choices implementing part of application. example, can have array of tcontrol
in form class, , using length
, setlength
functions can figure out how many objects user has added form.
Comments
Post a Comment