凤
凤冠坡
Unregistered / Unconfirmed
GUEST, unregistred user!
很多人提出了这个问题,就是在一个窗口里,有许多控件包括 DBGrid(EH),当焦点从
DBGrid(EH)移走时,输入法就会变成系统默认的输入法,这个问题的根源就在 DBGrid(EH)的 WMKillFocus 方法的那段程序,只要稍作修改:
procedure TCustomDBGridEh.WMKillFocus(var Message: TMessage);
.......................
if not SysLocale.FarEast
then inherited
else begin
ImeName := Screen.DefaultIme;
ImeMode := imDontCare;
inherited;
// 关键地方:去掉下面2行就可以了
// if not ((InplaceEditor <> nil) and (HWND(Message.WParam)
// = InplaceEditor.Handle))
// then ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);
end;
...................
DBGrid(EH)移走时,输入法就会变成系统默认的输入法,这个问题的根源就在 DBGrid(EH)的 WMKillFocus 方法的那段程序,只要稍作修改:
procedure TCustomDBGridEh.WMKillFocus(var Message: TMessage);
.......................
if not SysLocale.FarEast
then inherited
else begin
ImeName := Screen.DefaultIme;
ImeMode := imDontCare;
inherited;
// 关键地方:去掉下面2行就可以了
// if not ((InplaceEditor <> nil) and (HWND(Message.WParam)
// = InplaceEditor.Handle))
// then ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);
end;
...................