在你的Showmodal Form 里面设置一个局部常数, 类型为TImeMode, OnClose事件中保存输入法,<br>再次ShowModal的时候通过OnShow事件设置成所保存的输入法, 具体见下面例子:<br><br>unit Unit2;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> StdCtrls;<br><br>type<br> TForm2 = class(TForm)<br> Edit1: TEdit;<br> procedure FormClose(Sender: TObject; var Action: TCloseAction);<br> procedure FormShow(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form2: TForm2;<br><br>implementation<br><br>{$R *.DFM}<br><br>const<br> LastImeMode: TImeMode = imDontCare;<br><br>procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);<br>begin<br> LastImeMode := Edit1.ImeMode;<br>end;<br><br>procedure TForm2.FormShow(Sender: TObject);<br>begin<br> Edit1.ImeMode := LastImeMode;<br>end;<br><br>end.<br>