المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Prevent the ^ character from beeing entered in textbox.



C# Programming
09-01-2009, 05:40 PM
How can I prevent the ^ character from being typed in a textbox? The problem seems to be that the character is not added before another keydown/keyup event.

For some other keys I used the following code to prevent them from being typed:

void textBox_KeyUp(object sender, KeyEventArgs e)
{
if ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt)
{
if (e.PlatformKeyCode