1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
Public Class NumericTextBox
Private Sub IntegerTextBox_Paint(sender As System.Object, e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Me.Size = IntBox.Size
End Sub
Public Overridable Sub act(ByVal sender As Object, ByVal e As EventArgs)
Dim frm As Form = CType(sender, Form)
frm.Show()
End Sub
Private Sub IntBox_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles IntBox.KeyPress
If Asc(e.KeyChar) <> 8 Then
'If Asc(e.KeyChar) = 44 Then
'If IntBox.Text.Contains(",") Then
'e.Handled = True
'End If
'Exit Sub
'End If
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
End If
End If
End Sub
Public Overrides Function ToString() As String
'Return MyBase.ToString()
Return IntBox.Text.ToString
End Function
End Class |
Partager