16-05-13, 02:54 PM
هذا هو الكود
يستغدم هذا الكود لى نقل الايتم التى داخل الست بوكس مكان اخرى يعمل فى الست بوكس 1 لاكن لا يعمل فى الست بوكس 2
كود :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TabControl1.SelectedTab Is TabPage1 Then
If ListBox1.SelectedIndex > 0 Then
Dim I = ListBox1.SelectedIndex - 1
ListBox1.Items.Insert(I, ListBox1.SelectedItem)
ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
ListBox1.SelectedIndex = I
ElseIf TabControl1.SelectedTab Is TabPage2 Then
If ListBox2.SelectedIndex > 0 Then
Dim a = ListBox2.SelectedIndex - 1
ListBox2.Items.Insert(a, ListBox2.SelectedItem)
ListBox2.Items.RemoveAt(ListBox2.SelectedIndex)
ListBox2.SelectedIndex = a
End If
End If
End If
End Sub