How do I dynamically add and removing items to and from a list?
-
-
Xceed admin
-
-
-
Joined on 09-29-2008
-
Longueuil
-
Posts 443
-
-
|
How do I dynamically add and removing items to and from a list?
Create a blank VB project and add three controls to it: - A button with the name btnAdd. - A button with the name btnRemove. - An edit control with the name txtNewItem - A SmartUI control called SmartUI1
Then, in the button add event, you can use the following code to add an item to the list:
Private Sub btnAdd_Click() SmartUI1.SmartItems.Add , , txtNewItem.Text, ListItemFullRow End Sub
Private Sub btnRemove_Click() If Not SmartUI1.SelectedItem Is Nothing Then SmartUI1.SmartItems.Remove (SmartUI1.SelectedItem.Index) End If End Sub |
|
|
|
|
|
|