You are on page 1of 2

Dim iexit As DialogResult

iexit = MessageBox.Show("Confirm if you want to exit", "Ordering Foods",


MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If iexit = DialogResult.Yes Then

Application.Exit()
End If

Private Sub Txtid_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


txtid.KeyPress
If (Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57) Or Asc(e.KeyChar) = 46
Or Asc(e.KeyChar) = 8 Then

Else
e.Handled = True
MsgBox("Letter is not allowed, maglagay ka lang ng numbers... ")
End If
End Sub

Private Sub Txtage_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


txtage.KeyPress
If (Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57) Or Asc(e.KeyChar) = 46
Or Asc(e.KeyChar) = 8 Then

Else
e.Handled = True
MsgBox("Letter is not allowed, maglagay ka lang ng numbers... ")
End If
End Sub
End Class

You might also like