[Gambas-user] Creating controls at runtime
Benoit Minisini
gambas at ...1...
Thu Aug 12 23:42:04 CEST 2004
On Thursday 12 August 2004 23:38, Michael Sullivan wrote:
> I have a TODO list I keep in a text file that I have cron email to me
> every morning so that it's sitting in my email box when I get out of bed
> and check my email. I would like to write a GUI interface for working
> with my TODO list, but I'm not sure how I want to go about it. I want
> to be able to write the GUI completely in code if possible. I want to
> have labels displaying the tasks and check boxes to mark tasks
> completed, but since I never know ahead of time how many tasks there
> will be in the text file, I need to be able to load the labels, check
> boxes, etc at runtime. How would I do this?
>
DIM hLabel AS Label
hLabel = NEW Label(MyForm) AS "MyLabelName"
There is no difference between using the previous code or create the control
in the form editor. The same code is generated and compiled. Controls are
classes like the others (they just inherit the 'Control' class), and can be
created with the NEW method.
Regards,
--
Benoit Minisini
mailto:gambas at ...1...
More information about the User
mailing list