治不好的不孕症:DBGrid中失去焦点后输入法改变2
来源:百度文库 编辑:偶看新闻 时间:2024/04/30 16:38:35
使用DBGrideh控件时,每当焦点从此控件转移时,都会自动将输入法关闭,给用户输入数据带来很大的不便,原因就是DBgrideh在处理WM_killFocus时的代码有些小问题。
把dbgrideh.pas打开后找到下面二个过程,将打星号的语句注释掉就可以彻底解决此问题。
procedure TDBGridInplaceEdit.WMKillFocus(var Message: TWMKillFocus);
begin
if not SysLocale.FarEast then inherited
else
begin
* ImeName := Screen.DefaultIme;//将此句注释掉
ImeMode := imDontCare;
inherited;
//将此IF语句注释掉
* if HWND(Message.FocusedWnd) <> Grid.Handle then
* ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);
end;
if FListVisible and not
((Message.FocusedWnd = FActiveList.Handle) or
(GetParent(Message.FocusedWnd) = FActiveList.Handle)
) then
CloseUp(False)
else if MRUList.DroppedDown and not (Message.FocusedWnd = MRUListControl.Handle) then
MRUListCloseUp(MRUList, False);
// if (Message.FocusedWnd <> Grid.Handle) then
// Grid.ControlLeaveFocus;
if Grid.FSelectionActive <> Grid.IsSelectionActive then
Grid.SelectionActiveChanged;
end;
//==========
procedure TCustomDBGridEh.WMKillFocus(var Message: TWMKillFocus);
var
InvalidRect: TRect;
begin
if FSortMarking and
not ((InplaceEditor <> nil) and (Message.FocusedWnd = InplaceEditor.Handle)) then
begin
FSortMarking := False;
DoSortMarkingChanged;
end;
if HandleAllocated and (dgRowSelect in Options) then
begin
with inherited Selection do
InvalidRect := BoxRect(Left - FrozenCols, Top, Right, Bottom);
WindowsInvalidateRect(Handle, InvalidRect, False);
end;
if not SysLocale.FarEast
then inherited
else
begin
* ImeName := Screen.DefaultIme;//将此句注释掉
ImeMode := imDontCare;
inherited;
//将此If语句注释掉
* if not ((InplaceEditor <> nil) and (Message.FocusedWnd = InplaceEditor.Handle))
* then ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);
end;
// if not IsMyInplaceControlHandle(HWND(Message.WParam)) then
// ControlLeaveFocus;
if FSelectionActive <> IsSelectionActive then
SelectionActiveChanged;
end
把dbgrideh.pas打开后找到下面二个过程,将打星号的语句注释掉就可以彻底解决此问题。
procedure TDBGridInplaceEdit.WMKillFocus(var Message: TWMKillFocus);
begin
if not SysLocale.FarEast then inherited
else
begin
* ImeName := Screen.DefaultIme;//将此句注释掉
ImeMode := imDontCare;
inherited;
//将此IF语句注释掉
* if HWND(Message.FocusedWnd) <> Grid.Handle then
* ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);
end;
if FListVisible and not
((Message.FocusedWnd = FActiveList.Handle) or
(GetParent(Message.FocusedWnd) = FActiveList.Handle)
) then
CloseUp(False)
else if MRUList.DroppedDown and not (Message.FocusedWnd = MRUListControl.Handle) then
MRUListCloseUp(MRUList, False);
// if (Message.FocusedWnd <> Grid.Handle) then
// Grid.ControlLeaveFocus;
if Grid.FSelectionActive <> Grid.IsSelectionActive then
Grid.SelectionActiveChanged;
end;
//==========
procedure TCustomDBGridEh.WMKillFocus(var Message: TWMKillFocus);
var
InvalidRect: TRect;
begin
if FSortMarking and
not ((InplaceEditor <> nil) and (Message.FocusedWnd = InplaceEditor.Handle)) then
begin
FSortMarking := False;
DoSortMarkingChanged;
end;
if HandleAllocated and (dgRowSelect in Options) then
begin
with inherited Selection do
InvalidRect := BoxRect(Left - FrozenCols, Top, Right, Bottom);
WindowsInvalidateRect(Handle, InvalidRect, False);
end;
if not SysLocale.FarEast
then inherited
else
begin
* ImeName := Screen.DefaultIme;//将此句注释掉
ImeMode := imDontCare;
inherited;
//将此If语句注释掉
* if not ((InplaceEditor <> nil) and (Message.FocusedWnd = InplaceEditor.Handle))
* then ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);
end;
// if not IsMyInplaceControlHandle(HWND(Message.WParam)) then
// ControlLeaveFocus;
if FSelectionActive <> IsSelectionActive then
SelectionActiveChanged;
end
vb 怎样使一个command在点击后失去焦点?
kawaks 1.45失去焦点
delphi 中要改变dbgrid当前行的颜色怎么实现?
delphi 中要改变dbgrid当前行的颜色怎么实现?
word中如何改变输入法
DBGRID改变列属性(如何改列名)
用AppActivate后发送键的途中接收键的窗口为什么会失去焦点
dbgrid中数据太多,怎么办
怎样在DELPHI中自动设置DBGRID的宽度,其宽度随内容自动改变,程序如何写呢?
如何在游戏中改变输入法
完美世界中,如何改变输入法
这样改变输入法中各输入法的顺序啊
在VB中怎么才能让登录窗口失去焦点,而让密码窗口获得焦点,至到密码输入正确
改变输入法
我的鼠标为什么老是失去焦点?
输入文本自动失去焦点问题
vb中 dbgrid如何隐藏列?
VB中如何删除DBGrid指定行
delphi 中 dbgrid 的 Column.Field 是什么意思?
电脑中按住ctrl + shif 不能改变输入法是什么原因
xp系统中能改变输入法的顺序吗?
(高手请进)下拉框选择后,自动将焦点放到另一个本框中
我的电脑窗口最大化后将任务栏给盖住了,如何解决?以及ie中无法改变输入法的问题
旅游中如何成为焦点