B
Brian Robbins
In standard C/C++ SDK, MFC, or VCL if I wanted to make a
TextBox (CEditBox, TEditBox, etc.) only except numbers I
have dozens of ways to handle it. But none of those
methods are working in C#.NET. I may be just having a
paradigm shift issue and I just don't understand new the
methods fully, yet.
I would love to use the Validation methods, but they occur
WAY TOO LATE in the event order list! I don't want the
TextBox.Text to ever have an incorrect character in the
string. For example, if the user types an 'A' it should
never be added to the TextBox.Text. In C++ I would have
used the KeyDown event to filter values that aren't
numbers. In C# this appears impossible. The e.Key,
e.KeyData, etc. are readonly so I can't set them to null
(like I would have done in C++). The e.Handled property
don't seem to do anything of value.
So, fellow geniuses, please help me see what I am
overlooking.
Thanks,
Brian
TextBox (CEditBox, TEditBox, etc.) only except numbers I
have dozens of ways to handle it. But none of those
methods are working in C#.NET. I may be just having a
paradigm shift issue and I just don't understand new the
methods fully, yet.
I would love to use the Validation methods, but they occur
WAY TOO LATE in the event order list! I don't want the
TextBox.Text to ever have an incorrect character in the
string. For example, if the user types an 'A' it should
never be added to the TextBox.Text. In C++ I would have
used the KeyDown event to filter values that aren't
numbers. In C# this appears impossible. The e.Key,
e.KeyData, etc. are readonly so I can't set them to null
(like I would have done in C++). The e.Handled property
don't seem to do anything of value.
So, fellow geniuses, please help me see what I am
overlooking.
Thanks,
Brian