|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
VB ListBox
What is the code for deleting items from the listbox one at a time
during runtime? When I use Object.Removeitem Index, It only removes the first item from the list. I want it to remove the selected item from the list only. Last edited by jfg : December 18th, 2003 at 11:56 AM. |
|
#2
|
|||
|
|||
|
object.RemoveItem index
|
|
#3
|
|||
|
|||
|
VB ListBox
Thank you for replying.
When I use Object.Removeitem Index, It only removes the first item from the list. I want it to remove the selected item from the list only. |
|
#4
|
||||
|
||||
|
Code:
Private Sub Form_Load()
ListView1.ListItems.Add , , "TEST"
ListView1.ListItems.Add , , "TEST2"
End Sub
Private Sub cmdButton_Click()
Dim item As ListItem
Dim i As Integer
For i = 1 To ListView1.ListItems.Count
If (ListView1.ListItems(i).Selected) Then
ListView1.ListItems.Remove (i)
Exit For
End If
Next i
End Sub
|
|
#5
|
|||
|
|||
|
VB ListBox
Thank you for replying
It worked!!!!!!!!!!!!!!!!!!! Thanks again |
|
#6
|
|||
|
|||
|
Thank you also for helping your friend
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > VB ListBox |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|