Programming and use of Chinese character input method under Delphi

zhaozj2021-02-08  281

In the Chinese and Western Documentary Interface of many Windows applications, the entry of Chinese and Western needs to repeat the Chinese character input method, which is very cumbersome. In the process of developing a MIS using Delphi, I found a relatively simple solution. This article design environment is Delphi Client / Server Suit Ver3.0 (hereinafter referred to as Delphi3.0), Chinese Windows'95. IMENAME, IMEMODE attributes in Delphi3.0 in Delphi 3.0 TEDIT, TMEMO, TMASKEDIT and other editing components are often used in applications. These three components have iMename, IMEMODE properties, iMename properties are input method names, in objects The corresponding one includes a drop-down combo box including all Chinese character input methods in the current system. The IMEMode property is an input mode. In the object viewer, IMCLOSE, Imopen, Imchinese, Imdontcare, IMSalpha, in the combo box. IMALPHA six items: imclose indicates that the input method is closed. Imopen indicates that the input method is open. Imchinese means in Chinese input method. IMDontcare indicates that if the input method is turned off, the most recently used input method is turned on. IMSAlPha indicates that the input is in a half-angle state. IMalpha indicates that the input is in full shape. Second, the programming of the Chinese character input method in Delphi is in Delphi 3.0, the components involved in the Chinese and Western Document Interface have iMename, IMEMode properties. When designing an interface form, you can assign a value for each element, you can automatically open or close the Chinese characters input method you set automatically when the component is obtained. But this programming method, there is no flexibility to the user. If the input method set by the system is not what it is good, they have to re-select again through the Windows'95 input method selectors. The author puts a label and drop-down combination box under Form, which is more flexible to solve this problem. The form in the example places four Label, two Edit, a Combobox, Memo, and Button. The following is an example description: 1. Select New Application under the File menu to generate a new application in Delphi. Set the properties of the new form FORM1 CAPTION = input method programming example 2, add one or two tags Label1, Label2, Label3, and edit box Edit1, EDIT2, MEMO1, set its properties label1.caption = Chinese input edit box Label1.font.size = 12 label2.caption = Western input edit box label2.font.size = 12 label3.caption = Chinese multi-line text editor

转载请注明原文地址:https://www.9cbs.com/read-2030.html

New Post(0)