Creating a TAB Key in the Windows Dialog

I am working on a Windows project with a simple dialog created using CreateWindowEx(), it contains several panels loaded with CreateDialog()to load the layout from the resource file. There are several controls on the child panels, including text boxes and buttons that I would like to use TAB to navigate, but all I get is a “Windows Bing” telling me that the key does nothing. My message loop looks like this:

while( PeekMessage(&msg, 0, 0, 0, PM_REMOVE) )
{
    if( !IsDialogMessage(0, &msg) )
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
}

And each control window contains the WS_TABSTOP defined in the style, as well as the owner panel with WS_EX_CONTROLPARENT.

Is there anything else I need to do to make the tab key?

Thanks J

+3
3

:

http://support.microsoft.com/kb/71450 ( IsDialogMessage() )

- , IsDialogMessage Tab. , .

+3

WS_TABSTOP WS_TABSTOP , , TAB SHIFT + TAB.

TAB SHIFT + TAB, , , . WM_GETDLGCODE, DLGC_WANTTAB, . GetNextDlgTabItem , , , WS_TABSTOP. , , , , , . , .

WS_TABSTOP WS_EX_CONTROLPARENT, .

GetNextDlgTabItem , WS_TABSTOP. , WS_TABSTOP, .

: MSDN.

+2
if( !IsDialogMessage(0, &msg) )

The first argument must not be NULL; it must be a dialog handle. It is painful here, of course.

+1
source

Source: https://habr.com/ru/post/1766950/


All Articles