Form (gb.qt4)
The parent class of every form of a program.
This class inherits
Window.
This class can be used like an object by creating a hidden instance on demand.
This class is .
This class acts like a array.
|
Event management
By default, a form is its own event observer.
It means that all the events raised by the Form object are caught by event handlers defined in the form source code.
Automatic instance
Forms internally manages an automatic singleton instance.
It means that you can use the form class name as a form instance. The first time you do that, the internal
singleton is automatically created.
You can force the creation of the automatic instance by using the Load method.
Startup form
A form can be the startup class of the project, as it implements a Main
method. In that case, the automatic instance
of the form is used.
Examples
' Instanciate the automatic instance, move it and show it
MyForm.Move(90, 150)
MyForm.Title = "Automatic instance"
MyForm.Show
' Do the same thing with another instance of the same form
Dim hForm As MyForm
hForm = New MyForm
hForm.Title = "Another instance"
hForm.Move(110, 170)
hForm.Show
...
' Event handler in the MyForm source code
Public Sub Form_Open()
Print "Showing form: "; Me.Title
End