primetime692004
Member
- Joined
- Jan 24, 2005
- Messages
- 10
- Programming Experience
- Beginner
hey i wanna make a message box for my 3 text boxes so that when u go and input the amount it has to be in dollar form meaning u have to enter the $ first so how do u do the message box coding for that could someone help me out
i tried this coding but theres errors on the e.handled and e.keychar so id appreciate if someone could help this out for me thanks
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim testInt As Integer
Select Case e.KeyChar
Case Microsoft.VisualBasic.ChrW(36)
If TextBox1.Text.Length = 1 Then
e.Handled = False
Else
e.Handled = True
End If
Case Microsoft.VisualBasic.ChrW(48) To Microsoft.VisualBasic.ChrW(57)
If TextBox1.Text.Length > 0 Then
e.Handled = False
Else
e.Handled = True
MessageBox.Show("Please enter a dollar value, starting with the '$' sign.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
i tried this coding but theres errors on the e.handled and e.keychar so id appreciate if someone could help this out for me thanks
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim testInt As Integer
Select Case e.KeyChar
Case Microsoft.VisualBasic.ChrW(36)
If TextBox1.Text.Length = 1 Then
e.Handled = False
Else
e.Handled = True
End If
Case Microsoft.VisualBasic.ChrW(48) To Microsoft.VisualBasic.ChrW(57)
If TextBox1.Text.Length > 0 Then
e.Handled = False
Else
e.Handled = True
MessageBox.Show("Please enter a dollar value, starting with the '$' sign.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If