Recently I am writing a winformProgramThe key needs to be captured. the keycode captured with keypress in Chinese is always 229
I have checked a lot of information online and cannot solve this problem well.
Finally, I can only solve it in disguise.
Set imemode to disable unless you need to enter Chinese characters.
Use the textchanged event to process keys (cups...) Where Chinese characters are needed ...)
// Fix 229 bug <br/> textbox TB = (textbox) sender; <br/> If (TB. text. length> 0) <br/>{< br/> string stemp = TB. text; <br/> int iindex = stemp. indexof ('/'); <br/> If (iindex>-1) // key multiply <br/>{< br/> // something to do </P> <p> TB. TEXT = TB. text. remove (iindex, 1); <br/>}< br/> iindex = stemp. indexof ('*'); <br/> If (iindex>-1) <br/>{< br/> // something to do <br/> TB. TEXT = TB. text. remove (iindex, 1); <br/>}< br/>}