Form.AddComboBox

The AddComboBox function allows the script to add a combo box to the Form.

Syntax

Form.AddComboBox(X, Y, pStrings)

Description

Adds a combo box to a Form.

Arguments

X {integer}

Represents the horizontal position of the combo box on the Form—the position on the 'X-Axis'.

 

Y {integer}

Represents the vertical position of the combo box on the Form—the position on the 'Y-Axis'.

 

pStrings {string array}

Represents the options that are shown in the combo box.

Returns

Combo Box Control Object

Combo box Control Objects have common Control Object Properties as well as their own specific functions and properties that can be used in the script—see Combo Box Functions and see Combo Box Properties.

Example:

The following script creates a Form that has a combo box with 3 options (named Internal, Analog, and Digital respectively):

Public Sub ComboExample

Dim pStrings (2)

Dim frmCombo

 

pStrings(0) = "Internal"

pStrings(1) = "Analog"

pStrings(2) = "Digital"

 

Form.Init ("Point Type")

Set frmCombo = Form.AddComboBox(2,2,pStrings)

Form.Show

End Sub

The pStrings array is declared as a variable, with each of its options also defined before the Form.Init function. The Form.AddComboBox function then has the arguments of 2, 2 for the positioning of the combo box and pStrings is a reference to the pStrings variable (which is the string array).

Further Information

Combo Box Functions

Combo Box Properties.


Disclaimer

Geo SCADA Expert 2022