If you don't pay attention to a small function, it's hard for me, huh, huh.
To implement this function in. NET Framework, it is very simple: (there are two types)
1> set charactercasing of textbox to "upper"
2> responding to the textbox keypress event,CodeAs follows:
If (char. islower (E. keychar ))
E. keychar = Char. toupper (E. keychar );
In. NET Compact framework, these two methods are not supported.
1> textbox in. Net CF does not have the charactcasing attribute (opennet cf should be available)
2> E. keychar under the textbox keypress event in. Net CF is a read-only attribute.
So, I implement the following:
In response to the keyup event of Textbox, the Code is as follows:
Private void textbox1_keyup (Object sender, keyeventargs E)
{
Textbox1.text = textbox1.text. toupper ();
Textbox1.selectionstart = textbox1.text. length;
Return;
}
I wonder if you have a better implementation?