Private Sub TextBox_keyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs)
If Char.IsDigit(CChar(CStr(e.KeyChar))) = False Then e.Handled = True
End Sub
Private Sub TextBox_keyPress1(ByVal sender As Object, ByVal e As KeyPressEventArgs)
If Not (Char.IsDigit(CChar(CStr(e.KeyChar))) Or e.KeyChar = ".") Then e.Handled = True
End Sub
Private Sub Guide_DGV_EditingControlShowing(sender As Object, e As DataGridViewEditingControlShowingEventArgs) Handles Guide_DGV.EditingControlShowing
MsgBox(Guide_DGV.CurrentCell.ColumnIndex)
If Guide_DGV.CurrentCell.ColumnIndex = 2 Then
AddHandler CType(e.Control, TextBox).KeyPress, AddressOf TextBox_keyPress
ElseIf Guide_DGV.CurrentCell.ColumnIndex = 1 Then
AddHandler CType(e.Control, TextBox).KeyPress, AddressOf TextBox_keyPress1
End If
End Sub
'VB.net > DataGridView' 카테고리의 다른 글
DatagridView 이벤트 Numbers, Backspace & Delete 키 전용 VB.Net을 허용하려면 (0) | 2018.11.09 |
---|---|
데이터그리드뷰 복사하기 (0) | 2018.10.22 |
datagridview에서 선택한 Row의 Cell 값 가져오기 (0) | 2018.05.09 |
Datagridview 덧셈 (0) | 2018.03.16 |
Datagridview Rowheader 컨트롤 (0) | 2018.03.16 |