如果要使焦点移到上一个控件,要perform一个什么样的window message? (30分)

  • 主题发起人 主题发起人 xuaner
  • 开始时间 开始时间
X

xuaner

Unregistered / Unconfirmed
GUEST, unregistred user!
perform(wm_nextdlgctl,0,0) 是移到下一个,那移到上一个呢?
 
WM_NEXTDLGCTL
wCtlFocus = wParam; // identifies control for focus
fHandle = (BOOL) LOWORD(lParam); // wParam handle flag

Parameters
wCtlFocus
Value of wParam. If the fHandle parameter is TRUE, the wCtlFocus parameter
identifies the control that receives the focus. If fHandle is FALSE, wCtlFocus
is a flag that indicates whether the next or previous control with the WS_TABSTOP
style receives the focus. If wCtlFocus is zero, the next control receives the focus;
otherwise, the previous control with the WS_TABSTOP style receives the focus.

fHandle
Value of lParam. Contains a flag that indicates how the system uses the
wCtlFocus parameter. If the fHandle parameter is TRUE, wCtlFocus is a handle
associated with the control that receives the focus; otherwise, wCtlFocus is
a flag that indicates whether the next or previous control with the WS_TABSTOP
style receives the focus.
 
为什么不用控件获得焦点的方法?
 
perform(wm_nextdlgctl,1,0)行不行?
 
Form.KeyPreview := True;
Form.KeyDown Event:
begin
if Key = VK_RETURN then
PostMessage(TWinControl(Sender).Handle, WM_KEYDOWN, VK_TAB, 0);
end;
 
多人接受答案了。
 
后退
顶部