俘获Tab按键消息
Submitted by gougou on Sun, 2005-03-20 11:58
一般组件无法在OnKeyDown, OnKeyPress事件中俘获到Tab按键,要想俘获Tab按键消息,需要在你的组件中对WMGetDlgCode消息作处理,如下代码示意:
type
TSACombo=class(TComboBox)
protected
procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE;
end;
implementation
procedure TSACombo.WMGetDlgCode(var Message: TWMGetDlgCode);
begin
Inherited;
Message.Result := Message.Result or DLGC_WANTTAB;
end;