MaskedTextbox - allow only certain letters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Sm9hY2hpbQ==?=

    #1

    MaskedTextbox - allow only certain letters

    Can you make the MaskedTextbox to only allow certain letters e.g.

    10:11 A

    (Only allow A and P as input)
    ??
    I don't want any other letters than A or P to appear in the text box. I mean
    no post validation. Overriding the KeyPress function only allows me to
    disallow the key pressed to appear (by setting e.KeyChar = (char) 0;), but it
    doesn't allow me to see and test the complete string (I only can see the
    characters input before the current key, which I don't know at which position
    it is placed).
Working...