منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
لا تتم العملية بعد اضافة الكود - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : لا تتم العملية بعد اضافة الكود (/showthread.php?tid=8898)



لا تتم العملية بعد اضافة الكود - مبتدئ - 16-05-13

هذا هو الكود
كود :
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


لا تتم العملية بعد اضافة الكود - learning.net - 16-05-13

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