1

In Gambas I can create Controls like this:

btn = New Button(parent) As "MyButton"

Now events listen on:

MyButton_Click()

But how can I create Elements with dynamic name, like:

dim tmp as string
tmp = "MyButton"
btn = New Button(parent) As tmp

The last line does not work, but thats the question how to handle this.

1 Answers1

2

I have to attach the Object to its Parentform with this:

dim tmp as string
tmp = "MyButton"

btn = New Button(parent)
Object.Attach(btn, ParentForm, tmp)