08-06-17, 04:50 PM
08-06-17, 10:11 PM
جرب الكود التالي :
كود :
Private Sub myDataGridView_CellValidating(ByVal sender As Object,
ByVal e As DataGridViewCellValidatingEventArgs)
Handles myDataGridView.CellValidating
If myDataGridView.Item(e.ColumnIndex, e.RowIndex).Value Is Nothing Then
' Show the user a message
MessageBox.Show("You have left the cell empty")
' Fail validation (prevent them from leaving the cell)
e.Cancel = True
End If
End Sub13-06-17, 01:05 AM
(08-06-17, 10:11 PM)boudyonline كتب : [ -> ]جرب الكود التالي :
كود :
Private Sub myDataGridView_CellValidating(ByVal sender As Object,
ByVal e As DataGridViewCellValidatingEventArgs)
Handles myDataGridView.CellValidating
If myDataGridView.Item(e.ColumnIndex, e.RowIndex).Value Is Nothing Then
' Show the user a message
MessageBox.Show("You have left the cell empty")
' Fail validation (prevent them from leaving the cell)
e.Cancel = True
End If
End Sub
جزاك الله خيرا اخي الكريم جاري التنفيذ