The Forms collection contains all the currently open forms.
Newlook Smartclient
Newlook Server
Use the Forms collection to reference controls on forms that are currently open.
If you have a master form assigned to your solution, then this form will be the first item (0) in your forms collection.
The current host screen form will be an item in the collection (note, it will be the first item in the forms collection if you have no master form assigned). Any pop-up screen that is opened will create a subsequent item in the collection.
You can refer to an individual Form object by referring to its index within the collection. This is particularly useful if, for instance, you were wishing to refer to a property of a control on a form from which a pop up window was opened.
If you are wishing to refer to the current screen it is preferable to use the ActiveForm object.
You can reference controls on a master form by either referring to its index within the collection or explicitly referencing the MasterForm object in the control path. For example, if you wished to hide a control (called 'CompanyLogo') on your master form then you could use either of the following two forms of syntax:
App.MasterForm.CompanyLogo.visible = False
or
App.Forms(0).CompanyLogo.visible = False
Note that you can not reference a master form by its name.
It is preferable to use the App.MasterForm syntax when referencing the master form to avoid confusion.
The ActiveForm object can only be used to reference either the runtime form or a currently opened Added form, it cannot be used to reference the master form.
You can't add or delete form objects from the forms collection.
You can reference an individual item within any Newlook collection by using its Index. All indexes in Newlook are zero-based therefore if you wanted to return the third item in the collection you would use the following syntax:
object.collection(2)
Newlook Smartclient |
Newlook Server |
Deprecated
|
Obsolete
Property |
Client |
Description |
|
Returns the number of currently open forms. |
There are no methods that can be used with the forms collection.
The following example iterates through each form in the forms collection and examines the Popup property of each form to determine how many pop ups are open. VB SCRIPT:PopupCount = 0 ' Loop through all the forms in the form collection. For i = 0 To App.Forms.Count - 1 ' Determine if form is a pop up. If App.Forms(i).Popup = True Then PopupCount = PopupCount +1 End If Next |
ActiveForm object | Form object | MasterForm object | Newlook object model
© 2004-2021 looksoftware. All rights reserved.