25-02-25, 01:35 PM
وعليكم السلام ورحمة الله وبركاته
جرب التعديل التالي :
جرب التعديل التالي :
كود :
Dim i3 As Integer
Dim selectedItemText As String = CheckedListBox1.GetItemText(CheckedListBox1.SelectedItem)
For i3 = 0 To DataGridView1.Rows.Count - 1
Dim cellValue As Object = DataGridView1.Rows(i3).Cells(0).Value
If cellValue IsNot Nothing AndAlso String.Equals(cellValue.ToString(), selectedItemText, StringComparison.OrdinalIgnoreCase) Then
MsgBox("تم إدراج هذه المخالفة مسبقاً")
Dim clickedIndex As Integer = CheckedListBox1.SelectedIndex
If clickedIndex >= 0 Then
CheckedListBox1.SetItemChecked(clickedIndex, False)
End If
Exit For
End If
Next

