Hi Folks
I'm working on a small app that allows users to type alphanumeric values into a series of text boxes. I would like to automatically convert any lowercase text (a-z) typed into the box into uppercase (A-Z) as they are typing it.
I already know about the string.ToUpper() function, but my problem is that I can't seem to make it work. I'm trying to define the sender object like this:
TextBox txt = (TextBox)sender;
and then to change the text in the textbox thusly:
txt.Text.ToUpper();
But that is not working. It's telling me that the object txt is a textbox but when I try to address methods on it it says that I can't.
What am I going wrong?
Craig
I'm working on a small app that allows users to type alphanumeric values into a series of text boxes. I would like to automatically convert any lowercase text (a-z) typed into the box into uppercase (A-Z) as they are typing it.
I already know about the string.ToUpper() function, but my problem is that I can't seem to make it work. I'm trying to define the sender object like this:
TextBox txt = (TextBox)sender;
and then to change the text in the textbox thusly:
txt.Text.ToUpper();
But that is not working. It's telling me that the object txt is a textbox but when I try to address methods on it it says that I can't.
What am I going wrong?
Craig