I have two textbox controls on my form. One textbox is used for entering
text,numbers, other char's, etc. The other textbox control is used for
displaying the same info I type in the first textbox.
As I type each character, it should automatically add the same value to the
other textbox(concatenate all chars). However, as I type function keys,
shift, control,alt, etc, this is also transfer to the other text box. for
example, if I press the F1 key, 'F1' appears in the second textbox. If I
press shift+y, 'ShiftY' appears in the textbox.
How do I eliminate these special function keys and just display the text?
I'm trying to use Keys enumeration values but this seems like a tedious task
to code for all the combinations.
Second of all, when I press a letter and when I debug the keydown event, the
letter is in upper case, when I know that caps lock is not on. How do I make
sure if I type lowercase, it will appear lowercase or if I type uppercase, it
will appear uppercase?

Signature
Sincerely,
KA
Morten Wennevik - 29 Dec 2004 18:28 GMT
Hi GTDriver,
You could capture the KeyPress event and check if the KeyChar property of
the KeyPressEventArgs is of type Char.IsLetterOrDigit(), if so, pass it on
to the other TextBox, if not, ignore it. However, you may need to take
into account deletion of characters involving moving the cursor and
deleting a selection.
> I have two textbox controls on my form. One textbox is used for entering
> text,numbers, other char's, etc. The other textbox control is used for
[quoted text clipped - 19 lines]
> uppercase, it
> will appear uppercase?

Signature
Happy Coding!
Morten Wennevik [C# MVP]