Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

Windows Common Control List Methods

  • Last UpdatedJul 13, 2023
  • 3 minute read

You can use the methods of the Windows common controls to manipulate the controls at run time by using them in scripting.

The following table contains a list of methods you can use in scripting to:

  • Load and save the contents of the Edit Box control from and to a file.

  • Manipulate items in the lists of the List Box control and Combo Box control.

  • Manipulate items in the lists of the List Box control and Combo Box control.

Method

Purpose, syntax and information

AddItem

Purpose: Add an item (coerced to String) to the list. If the list is sorted, then the new item is inserted at the right position and selected. If the list is unsorted, the item is added to the bottom of the list.

Used by: Combo Box, List Box

Note: This function does not work when using an Enum or Array to populate the List Box.

Syntax: ControlName.AddItem(CaptionString);

Info:Adding and Inserting Items into a List

Clear

Purpose: Removes all items from the List. If the list is bound, it clears the bound reference (array or enum).

Note: This function does not work when using an Enum or Array to populate the List Box.

Used by: Combo Box, List Box

Syntax: ControlName.Clear();

Info: Deleting Items from a List

DeleteItem

Purpose: Accepts an index as a parameter and removes that item from the list. The first item in the list has an index of 0.

Used by: Combo Box, List Box

Syntax: ControlName.DeleteItem(Index);

Info: Deleting Items from a List

DeleteSelection

Purpose: Delete the currently selected item from the list.

Used by: Combo Box, List Box

Syntax: ControlName.DeleteSelection();

Info: Deleting Items from a List

FindItem

Purpose: Accepts a string as a parameter and returns the index of the first item that matches the string. The first item in the list has an index of 0.

Used by: Combo Box, List Box

Syntax: ControlName.FindItem(SearchString);

Info: Finding an Item in a List

GetItem

Purpose: Returns the item associated with an index supplied as a parameter to this function. The first item in the list has an index of 0.

Used by: Combo Box, List Box

Syntax: ItemCaption = ControlName.GetItem(Index);

Info: Reading the Caption of a Selected Item in a List

InsertItem

Purpose: Inserts the supplied string after the current selection in the List. Does not work if list is sorted.

Used by: Combo Box, List Box

Syntax: ControlName.InsertItem(String);

Info: Adding and Inserting Items into a List

SetItemData

Purpose: Associates a value with an item in the list which index is provided to the function. The first item in the list has an index of 0.

Note: This function only works when UseValuesAsItems is set to false. It does not work when using an Enum or Array to populate the List Box control.

Used by: Combo Box, List Box

Syntax: ControlName.SetItemData(Index,Value);

Info: Associating Items with Values in a List

GetItemData

Purpose: Returns the value associated with the item in the list which index is supplied to the function. The first item in the list has an index of 0.

Note: This function only works when UseValuesAsItems is set to false. It does not work when using an Enum or Array to populate the List Box control.

Used by: Combo Box, List Box

Syntax: Value = ControlName.GetItemData(Index);

Info: Associating Items with Values in a List

LoadList

Purpose: Loads a list of strings from a file which name is passed as parameter to the function. The default location for files is the users folder, for example: c:\documents and settings\username.

Note: The LoadList method does not work when using an Enum or Array to populate the List Box control.

Used by: Combo Box, List Box

Syntax: ControlName.LoadList(FileName);

Info: Loading and Saving Item Lists

LoadText

Purpose: Loads a text from a file into the Edit Box control. The default location for files is the users folder, for example: c:\documents and settings\username.

Used by: Edit Box

Syntax: ControlName.LoadText(FileName);

Info: Configuring Edit Box Methods

SaveList

Purpose: Save a list to a file which name is passed as parameter to the function. The default location for files is the users folder, for example: c:\documents and settings\username.

Used by: Combo Box, List Box

Syntax: ControlName.SaveList(FileName);

Info: Loading and Saving Item Lists

SaveText

Purpose: Saves the current text in the Edit Box control to a file. The default location for files is the users folder, for example: c:\documents and settings\username.

Used by: Edit Box

Syntax: ControlName.SaveText(FileName);

Info: Configuring Edit Box Methods

Windows Common Control List Methods

TitleResults for “How to create a CRG?”Also Available in