HB++ community
jonathanelkins
Joined: 14 Apr 2007 Posts: 13 Location: Vancouver, BC, Canada |
Posted: Mon Mar 08, 2010 4:29 am
Dynamically creating controls on a form |
|
Hello HB++ Community,
Is there any way for me to create additional, say, buttons on a form once my application is running?
I want to add more buttons in my app on a Palm TX when the DIA is hidden. How can I do this?
Also I would like to programatically refer to each control by an index like this:
lst = RefControlByName("List" + Int2Str(index))
Is this possible? Is there a way to dynamically refer to a user control as in this fictional function that I call RefControlByName?
-Jonathan
|
Pascal Site Admin
Joined: 01 Aug 2003 Posts: 914
|
Posted: Mon Mar 08, 2010 9:32 am
|
|
Hi,
You can't dynamically create controls. Actually Palm OS does allow you create some controls, but in a so limited way that we chose not to implement this in HB++.
You can't either refer to a control from a string containing its name. A control name is no more that a variable name. HB++ is not a reflective language, variable names are lost at compilation.
However, you can probably achieve what you want using an array of controls. Refer to "Home > Language Reference > Design Time Properties > Index" in the documentation.
Pascal
|
jonathanelkins
Joined: 14 Apr 2007 Posts: 13 Location: Vancouver, BC, Canada |
Posted: Mon Mar 08, 2010 11:43 pm
|
|
That's too bad. But thank you for the advise.
|
You
cannot post new topics in this forum
You
cannot reply to topics in this forum
You
cannot edit your posts in this forum
You
cannot delete your posts in this forum
You
cannot vote in polls in this forum