here i have 2 listbox i already have the code for the selected item moving right and moving left but i don't know how to move all of the listbox1 to listbox2 by just click >> or listbox2 to listbox1 <<
Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button.Click
Dim i, j As Integer
i = ListBox1.Items.Count()
For j = 0 To i - 1
Actually if you want to transfer ALL items from one listbox to another then you can simple do that like the sample below. No looping needed.
Private Sub MoveToBox2_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Private Sub MoveToBox1_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
The above sample code is ONLY for the "<<" and ">>" buttons, no selection required. It takes ALL items from listbox1 and moves it to listbox2. But there is a leak...if a user already moved some items from box1 to box2 then those items are lost.
So the question is, do you get the listbox items froma datasource? if so, please tell us from what datasource, so we can adjust the example.