Private Sub textbox1_TextChanged(sender As Object, e As EventArgs) Handles textbox1.TextChanged
Try
me.text_total.text = CDec(Me.dgTI.CurrentRow.Cells(2).Value) * CDec(me.textbox1.text)
Catch ex As Exception
End Try
End Sub
Private Sub textbox1l_KeyPress(sender As Object, e As KeyPressEventArgs) Handles textbox1.KeyPress
Select Case Asc(e.KeyChar)
Case 48 To 57 ' key โค๊ด ของตัวเลขจะอยู่ระหว่าง48-57ครับ 48คือเลข0 57คือเลข9ตามลำดับ
e.Handled = False
Case 8, 13, 127 ' ปุ่ม Backspace = 8,ปุ่ม Enter = 13, ปุ่มDelete = 46
e.Handled = False
Case Else
e.Handled = True
End Select
End Sub