How do I use 'created' controls?
Posted
#1
(In Topic #648)
Regular

I’m trying for the first time to ‘create’ a Control and use it, like this:
Everything looks fine. The button appears where it should. Gambas doesn’t throw any errors at me.
So why doesn’t clicking MyButton work?
I can’t find any really clear and simple examples on how to use created controls.
Old african saying:
You eat an elephant one small bite at a time.
You eat an elephant one small bite at a time.
Posted
Guru

Dim myButton As Button = New Button(Me) As "MyButton"
Probably best to not create the button in the public namespace and put on the form open function.
So…
Public MyButton As Button
Public Sub Form_Open()
With MyButton = New Button(Me) As "MyButton"
Etc….
Posted
Regular

Now I'm getting somewhere …..
But it would be a lot easier for a beginner if there were some examples to be found, wouldn't it.
Another bite of the elephant gone
Old african saying:
You eat an elephant one small bite at a time.
You eat an elephant one small bite at a time.
Posted
Guru

But it would be a lot easier for a beginner if there were some examples to be found, wouldn't it.
Have a look at this example here.
The use of Quit is not recommended for GUI programs, you should use Me.Close.
Posted
Guru

Doctor Watson said
Thanks Bruce.
Now I'm getting somewhere …..
But it would be a lot easier for a beginner if there were some examples to be found, wouldn't it.
Another bite of the elephant gone
You are using the New keyword.
See the wiki for New
/lang/new - Gambas Documentation
the examples you have not yet found are there.
Less speed more read my friend
1 guest and 0 members have just viewed this.


