要求:在程序启动后,如果切换输入法后,只要不再次切换,其输入法应一直不变。我把所有控件(输入框、DBGRID等)的 输入模式都设置为DON'T CARE,即事先不设输入法。这样在同一窗体或窗体间切换时都可以不变输入法,但如果点击了DBRID后,再进入另一个窗体,输入法就自动关闭,如不点击DBGRID,一切正常。我都检查了DBGRID的属性了,试问怎么解决?
解决方案 »
- 请教 MediaPlayer1 的 如何设置 filename ?
- 做过IE浏览器开发的进来,100分请教
- 100分求高手解决ado+access的问题
- 关于图像区域选定的问题,请大家帮帮忙,分分不够再加
- 我参加高程,请问学习Delphi用什么书好?请说明作者,出版社,书名,翻译者,版本!不胜感激! 在线等候!
- 过程的调用方法?急等!!!!!
- 为什么给Form增加的属性在Object Inspector中看不到?
- 如何获取报表总共页数?
- 请问怎样得到一个文件夹下的最早文件和最新文件的名字(不要用FindNext)?
- 请教高手关于visual sourcesafe的问题.
- 各位前辈请指教啊,急。。。。。。。。。。。。。。。
- 在对ADOQUERY进记录插入时,如何才能让ADOQUERY按操作员插入的次序显示?急....
好像是这里吧
在DBGrids.pas
procedure TCustomDBGrid.WMKillFocus(var Message: TMessage);
begin
if SysLocale.FarEast then inherited
else
begin
ImeName := Screen.DefaultIme;
ImeMode := imDontCare;
inherited;
if not ((InplaceEditor <> nil) and
(HWND(Message.WParam) = InplaceEditor.Handle)) then
ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);
end;
end;
procedure TForm6.FormCreate(Sender: TObject);
begin
var
myhkl: hkl;
i: integer;
begin
myHKL:=GetKeyBoardLayOut(0);
for i := 0 to Screen.Imes.Count-1 do
begin
if HKL(Screen.Imes.Objects[i]) = myHKL then
srf := Screen.Imes.Strings[i];//当前输入法名称,srf为全局变量
end;
end;//将用户设置的输入法赋值给编辑控件
Procedure TForm2.SetIme;
var
i:Integer;
begin
for i:=ComponentCount-1 DownTo 0 do
begin
if (Components[i] is TEdit) then (Components[i] as TEdit).ImeName:=Form1.MyImes;
if (Components[i] is TCombobox) then (Components[i] as TCombobox).ImeName:=Form1.MyImes;
end;
end;