Control the input method in the C # Application (convert)

Source: Internet
Author: User
Control input methods in C # Applications

Generally, at least three input methods are installed in Windows systems, and the input methods are often switched when input data is input. Although the Windows system provides a shortcut for switching, it still brings a lot of trouble to the input work. If you provide users with intelligent input method automatic switching in applications, such applications will become more professional and competitive. I don't know if you can use Access. When you input table data, Access automatically switches to the input method. It's cool. Now you can do it all. If you want your program to be cool, continue...
To control the input method, the. NET class library is supported in the System. Windows. Forms. InputLanguage class. I plan to spend a little time talking about the InputLanguage class functions, and then give an instance input?agerichedit.
1. The InputLanguage class is a sealed class that provides many methods and attributes to implement the management of input methods. Several of these attributes are particularly important. I will explain them one by one below, if you want to fully understand all the methods and attributes of the class, go to MSDN.
Public static InputLanguage CurrentInputLanguage {get; set ;}
// Obtain or set the input method of the current thread.
Public static InputLanguage DefaultInputLanguage {get ;}
// Obtain the default input method.
Public static InputLanguageCollection installedinputages {get ;}
// Obtain the system input method set. You can use this container object to list the input methods currently installed by the system.
Public string LayoutName {get ;}
// Obtain the registration name of the input method in the system tray.
......
2. We have studied several important attributes provided by the InputLanguage class. Now we can start to apply the InputLanguage class in application development. I want to create a. NET Window Form System program, use a list box to list all input methods installed in the current system, and automatically change the input method of the current thread by changing the options in the list box. At the same time, the options of the list box are changed based on the input method changes in the desktop tray.
(1) create a project --> Select "Visual C # Project" --> enter the project name: input1_agerichedit.
(2) drag a RichTextBox control in the toolbox and name it richTextBox1. A ComboBox control named combox1 and a Button control named But_Exit.

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.