Jump to content
Sign in to follow this  

Dynamic controlls

Recommended Posts


Hi, I have a problem with diferent instances of one controll.

Lets say, I have a two tabs.

On the first is radio button "Do you have a car? - YES/NO". I check "NO".

On the second tab I have an edit "Name:". This edit have controllID "INSTANCE:1"

But if on first tab I check "YES", there will display a new edit controll, let say "Type of your car:" with controllID "INSTANCE:1"

Now edit "Name" on second tab have controllID "INSTANCE:2"

It mean, if I change something on first tab, my script will not work :)

Is some chance to have a stable IDs for controlls?

PS: sorry about my english muttley

Share this post

Link to post
Share on other sites

There are several workarounds, I don't know if you need this, but it could be a solution:

- use "[ACTIVE]" instead of [iNSTANCE:1] -> this is more the dynamic kind of work

- use CASE (or if else) statements to check the different cases

- @GUI_CtrlHandle -> Last click control handle. Only valid in an event Function. See the GUICtrlSetOnEvent function.

If you find another solution, I would like to hear it

In the beginning there was nothing and then even that exploded - anonymous

Share this post

Link to post
Share on other sites

Thx for your response.

Im not using my app only once.

Its like for counting people and their property.

First step - I click on button "Add" and fill name and surname.

Second step - Have a car?

Third step - Have a house? ..and so on

Then I will not exit app but click on first tab and add another people.

But than will application do automatic tests.

So if first people have a car, on another tabs editbox have a controll instance plus 1

If second people dont have a car, the editboxes are still instances plus 1..

Its why I cannot use your ideas.

Only way I see have instances not default, but like variables and then use CASE or GUICtrlSetOnEvent for changing them.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this