AddItem Methods
Adds an item to a list.
Syntax
object.RLAddItem item[, index]
object.LLAddItem item[, index]
The syntax of the AddItem methods has these parts:
| Part | Description |
| object | A DCombo control. |
| item | String expression to add to the list. If item is a literal constant, enclose it in quotation marks. |
| index | Specifies where the new item is to be inserted in the list. An index of 0 represents the first position. If index is omitted, the item is inserted at the end (or in the proper sorted order). |
Remarks
While list items are normally added in the Form_Load event procedure, when using the left list as a filter for the right list, populate the right list in the LLClick event.
'Populate the left list
Private Sub Form_Load()
DCombo1.LLAddItem "A Test"
DCombo1.LLAddItem "B Testing"
DCombo1.LLAddItem "C Test"
DCombo1.LLAddItem "D Testing"
DCombo1.LLAddItem "E Test"
DCombo1.LLAddItem "F Testing"
'Fires the LLClick event and populates the right list
DCombo1.LLListIndex = 2
End Sub
Private Sub DCombo1_LLClick(ByVal LLIndex As Integer)
Dim i As Integer
DCombo1.RLSetRedraw False
DCombo1.RLClear
Select Case LLIndex
Case 0
For i = 0 To 30
DCombo1.RLAddItem i & " A Testing"
Next
DCombo1.RLListIndex = 0
Case 1
For i = 0 To 30
DCombo1.RLAddItem i & " B Testing"
Next
DCombo1.RLListIndex = 1
Case 2
For i = 0 To 30
DCombo1.RLAddItem i & " C Testing"
Next
DCombo1.RLListIndex = 2
Case 3
For i = 0 To 30
DCombo1.RLAddItem i & " D Testing"
Next
DCombo1.RLListIndex = 3
Case 4
For i = 0 To 30
DCombo1.RLAddItem i & " E Testing"
Next
DCombo1.RLListIndex = 4
Case 5
For i = 0 To 30
DCombo1.RLAddItem i & " F Testing"
Next
DCombo1.RLListIndex = 5
End Select
DCombo1.RLTopIndex = 0
DCombo1.RLSetRedraw True
End Sub
Data Type
item String
index
Integer