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
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.
k12/k12.10/start.txt · Last modified: by 127.0.0.1