现在的位置: 首页 > 综合 > 正文

用于控制Tab键的函数

2013年04月12日 ⁄ 综合 ⁄ 共 1415字 ⁄ 字号 评论关闭
 

关于CWnd::GetNextDlgTabItem
CWnd* CWnd::GetNextDlgTabItem(
        CWnd* pWndCtl, 
        BOOL bPrevious = FALSE) const;
COleControlSiteOrWnd* CWnd::GetNextDlgTabItem(
           COleControlSiteOrWnd *pCurSiteOrWnd, 
        BOOL bPrevious) const;
Retrieves a pointer to the first control that was created with the WS_TABSTOP style and that precedes or follows the specified control.
The input focus directs all subsequent keyboard input to this window. Any window that previously had the input focus loses it. The SetFocus member function sends a WM_KILLFOCUS message to the window that loses the input focus and a WM_SETFOCUS message to the window that receives the input focus. It also activates either the window or its parent.
If the current window is active but does not have the focus (that is, no window has the focus), any key pressed will produce the messages WM_SYSCHAR, WM_SYSKEYDOWN, or WM_SYSKEYUP.
Parameters
pWndCtl
Identifies the control to be used as the starting point for the search.
pCurSiteOrWnd
Identifies the COleControlSiteOrWnd control. For more information about COleControlSiteOrWnd, see CWnd::GetNextDlgGroupItem.
bPrevious
Specifies how the function is to search the dialog box. If TRUE, the function searches for the previous control in the dialog box; if FALSE, it searches for the next control.
Return Value
Pointer to the previous or next control that has the WS_TABSTOP style, if the member function is successful. The returned pointer may be temporary and should not be stored for later use.
例如:
CWnd* pWnd = GetParent()->GetNextDlgTabItem(this);
if (pWnd)
      pWnd->SetFocus();
else
      GetParent()->SetFocus();

抱歉!评论已关闭.