02-06-19, 03:20 AM
(آخر تعديل لهذه المشاركة : 02-06-19, 03:21 AM {2} بواسطة ابراهيم ايبو.)
السلام عليكم اخي العيدروس
ضع هذا الكود بالاول
PHP كود :
Dim n As Integer = 1
If ComboBox1.Items.Count < 7 Then
ComboBox1.Items.Add(n)
ElseIf ComboBox1.Items.Count >= 7 Then
Dim r As Integer = (ComboBox1.Items.Count \ 7) + 1
ComboBox1.Items.Add(r)
End If
ثم ضع كودك هذا بهذا الشكل
PHP كود :
Dim Cmd As New OleDbCommand("Select max(TeamID) from TableTeam", Conne)
If Conne.State = ConnectionState.Closed Then Conne.Open()
Dim Result As Object = Cmd.ExecuteScalar
Dim Record As Integer
If Result Is Nothing Then
Record = 1
Else
Record = CInt(Result) + 1
End If
TextBox1.Text = Record.ToString()
ثم اضف هذين السطرين
PHP كود :
ComboBox1.SelectedIndex = Nothing
ComboBox1.SelectedIndex = ComboBox1.Items.Count - 1
وان شاء الله الامور تمام
اعمل الخير وأجرك لا تنتظره فالله خير من إليك يرده
البرمجة ليست مجرد كود بل هي منهج تفكير منطقي لحل المشكلات
