How to solve the keycode 229 Problem

Source: Internet
Author: User

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/>} 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.