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.

    Code:
    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.
    Code:
    Sub RceEd_KeyPress (key)
     
    MsgBox(key)
     
    if key = "2" then RceEd.IgnoreKey
    End Sub
     
Loading...