Help Again???

Posts 1–11 of 11 · Page 1 of 1
Help Again???
hey guys i need some help on my injector


so like somepeople know i replaced the textbox with a Listbox

so i added a 2 buttons

first button clear the whole list

second button clears the selected dll on the list


so does anyone know the code for these cuz the listbox doesnt understand the code ".clear"
i think u should use something like listbox1.refresh , i could be wrong ,im just a chooby, but u can always try XD
ListBox1.Items.Clear() - Clears ALL
haha,thanx, im still learning the basics XD
no problem

< noob in vb, tho =D
yep that works and now i need for the selected items
hmmm let's wait for nextgen1 xD
@ Waiting for me



@ answer

Code:
For i As Integer = (ListBox1.SelectedItems.Count - 1) To 0 Step -1
            ListBox1.Items.Remove(ListBox1.SelectedItems(i))
        Next
Example

Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ListBox1.Items.Add("1")
        ListBox1.Items.Add("2")
        ListBox1.Items.Add("3")
        ListBox1.Items.Add("4")
        ListBox1.Items.Add("5")
        ListBox1.Items.Add("6")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        For i As Integer = (ListBox1.SelectedItems.Count - 1) To 0 Step -1
            ListBox1.Items.Remove(ListBox1.SelectedItems(i))
        Next
    End Sub
End Class
Not a Problem, Have Fun
Posts 1–11 of 11 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us