منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : لا تتم العملية بعد اضافة الكود
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
هذا هو الكود
كود :
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
يستغدم هذا الكود لى نقل الايتم التى داخل الست بوكس مكان اخرى يعمل فى الست بوكس 1 لاكن لا يعمل فى الست بوكس 2
PHP كود :
If TabControl1.SelectedTab Is TabPage1 Then
            
If ListBox1.SelectedIndex 0 Then
                Dim I 
ListBox1.SelectedIndex 1
                ListBox1
.Items.Insert(IListBox1.SelectedItem)
                
ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
                
ListBox1.SelectedIndex I
           End 
If
        ElseIf 
TabControl1.SelectedTab Is TabPage2 Then
            
If ListBox2.SelectedIndex 0 Then
                Dim a 
ListBox2.SelectedIndex 1
                ListBox2
.Items.Insert(aListBox2.SelectedItem)
                
ListBox2.Items.RemoveAt(ListBox2.SelectedIndex)
                
ListBox2.SelectedIndex a
            End 
If
        
End If