WinCC.net

Home
FAQs
Downloads
Feedback

FAQs

Using the Microsoft Forms 2.0 ComboBox Control

The Smart Object TextList is a drop down list control. However the list contents can only be configured in development. The Microsoft Forms 2.0 Combo Box Control can be configured in runtime.

The Microsoft Forms 2.0 Controls are installed automatically when Microsoft Office is installed. They are a series of ActiveX controls which may be used in a WinCC project. A useful control is the Combo Box control. This allows the user to select from a dynamically populated drop-down list.

To populate the Combo Box Control you need to call the .AddItem method.

e.g.

Dim combo1
Set combo1 = ScreenItems(“combo1”)
combo1.AddItem "Red"

The Combo Box Control can be configured to use multiple columns. To populate additional columns you need to use the .List property. This property has two parameters - column and row.

e.g.

Dim combo1
Set combo1 = ScreenItems(“combo1”)
combo1.AddItem "Red"
combo1.List(0,1) = “Blue”

NOTE: The .List property uses zero-based arrays. This means that the first element in the array has an index value of 0. So here we are referencing the first row and the second column in the combo box.

There is an example that shows how to populate the Combo Box Control using a VBS script in the downloads section.

2007 Salma Ghafoor