网上有2种说法: DBGrids.pas文件中 if not 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); 一种是把 if not SysLocale.FarEast then inherited 改为 if SysLocale.FarEast then inherited 另一种是把ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);注释掉 我两种方法都试了还是不行,请教改成功了的高手指教下。
DBGrids.pas文件中
if not 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);
一种是把 if not SysLocale.FarEast then inherited 改为
if SysLocale.FarEast then inherited
另一种是把ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);注释掉
我两种方法都试了还是不行,请教改成功了的高手指教下。
有imemode,imename,screen.imes这种可以获取或设置输入法
但也解决不了楼主的问题
关注。。
------------------------------------------------------------------------------------
其实,思路还是比较简单的,就是进入窗口时把默认输入法保存下来,进入DBGrid后设置为你所需要的输入法,离开DBGrid后还原为进入窗口时保存下来的输入法。
begin
设置输入法
end;procedure TForm1.DBGrid1ColExit(Sender: TObject);
begin
还原输入法
end;