Handheld Basic for Windows CE and Palm OS smartphones

HB++ community

Dynamically creating controls on a form

Index | User interface and controls
Reply to this topic | Print this topic | New topic | Search << >>
Page 1 of 1

Message
jonathanelkins


Joined: 14 Apr 2007
Posts: 13
Location: Vancouver, BC, Canada

PostPosted: Mon Mar 08, 2010 4:29 am 

Dynamically creating controls on a form

Reply with quote

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

View user's profile Send private message Send e-mail

Pascal
Site Admin

Joined: 01 Aug 2003
Posts: 914

PostPosted: Mon Mar 08, 2010 9:32 am 

Reply with quote

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

View user's profile Send private message

jonathanelkins


Joined: 14 Apr 2007
Posts: 13
Location: Vancouver, BC, Canada

PostPosted: Mon Mar 08, 2010 11:43 pm 

Reply with quote

That's too bad. But thank you for the advise.

View user's profile Send private message Send e-mail

Display posts from previous:   
Page 1 of 1
Index | User interface and controls
Reply to this topic

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