Validate TextBox entry

Discussion in 'Questions (Windows Mobile)' started by BPak, Apr 30, 2007.

  1. BPak

    BPak Active Member Licensed User

    I want to check the key input for the Text Box so as to prevent a user entering wrong letters or numbers.

    Sub RceEd_KeyPress (key)
    '   MsgBox(key)
    '   if key = "2" then key = ""
    '   tmp = RceEd.Text
    '   if key = "2" then RceEd.Text = tmp
    End Sub
    Tried the two ways shown in code but does not work for.

    Any examples on this method please?
  2. Erel

    Erel Administrator Staff Member Licensed User

    You should use the IgnoreKey method.
    Sub RceEd_KeyPress (key)
    if key = "2" then RceEd.IgnoreKey
    End Sub
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice