ResetListBoxContent method (WinStudio scripts)
Applies To
IWSFormComponent interface, List component type objects
Definition
Resets a list box, emptying its contents.
Syntax
object.ResetListBoxContent( )
Part | Description |
object | Required. A reference to a list box (List type component). |
Example
Sub Main() Dim oListBox As IWSFormComponent Dim iCurrentRow As Integer oListBox = ThisForm.Components("list1") 'Check to verify that a list item is selected. 'If not, display a message and exit. iCurrentRow = oListBox.GetListBoxCurSel If iCurrentRow = -1 Then Application.ShowMessage("No list item selected!") Exit Sub End If 'Display list box properties. Application.ShowMessage("Number of items: " & oListBox.GetListBoxCount().ToString() _ & vbLf & "Current selection: " & (iCurrentRow + 1).ToString() & vbLf & _ "Text: " & oListBox.GetListBoxText(iCurrentRow)) oListBox.ResetListBoxContent() End Sub