User Tools

Site Tools


k12:k12.10:start

12.10 Class Windows

The class Windows (gb.qt4) returns a collection of all windows opened by a Gambas program. The (static) class has only one property: Windows.Count returns the number of windows opened by a Gambas program. You can use the Windows class like a read-only array.

Example:

Public Sub btnShowInformations_Click()
 Dim i As Integer
 Dim hWindow As Window
 
  Print "Number of open windows = "; Windows.Count
  Print
  For Each hWindow In Windows
      Inc i
      Print i; ". Window: "; "Caption =      "; hWindow.Caption
      Print i; ". Window: "; "Window-height = "; hWindow.H
      Print "------------------------------------------"
  Next
 
End '  btnShowInformations

B1
Figure 12.10.1: Three open windows of a Gambas programme.

For the application with three open windows → Figure 12.10.1 results in the following output in the console of the IDE:

Number of open windows = 3

1. Window: Caption =      un-embed-forms
1. Window: Window-height = 336
------------------------------------------
2. Window: Caption =      Window 1
2. Window: Window-height = 144
------------------------------------------
3. Window: Caption =      Window 2
3. Window: Window-height = 144
The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k12/k12.10/start.txt · Last modified: 01.02.2022 (external edit)

Page Tools