4
我正在使用簡單的對話框。該對話框是從資源文件創建的。當創建一個對話框WS_CHILD時,一切正常。我可以使用VK_TAB鍵輕鬆切換項目(編輯框和按鈕)。但是,當我嘗試將對話框類型更改爲WS_POPUP時,元素之間的切換變得不可能。焦點卡在第一個元素上,當我按下VK_TAB鍵時,系統會發出警報聲音(如「ding」)。有什麼建議麼?WS_CHILD對話框上的WS_TABSTOP
編譯器:GCC 4.6.X
資源例如:
DIALOG_CLIENT_SETTINGS DIALOG 0, 0, 156, 132
STYLE WS_CHILD | WS_VISIBLE | DS_CONTROL // Tab key stucks when change to WS_POPUP
CAPTION "Settings"
FONT 8, "Ms Shell Dlg"
LANGUAGE LANG_NEUTRAL, 0
{
CONTROL "Account Settings", IDC_GROUPBOX_1, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 8, 4, 140, 50
CONTROL "Login:", IDC_STATIC_1, "STATIC", SS_RIGHT | WS_CHILD | WS_GROUP | WS_VISIBLE, 16, 20, 40, 8
CONTROL "Password:", IDC_STATIC_2, "STATIC", SS_RIGHT | WS_CHILD | WS_GROUP | WS_VISIBLE, 16, 36, 40, 8
EDITTEXT IDC_EDIT_1, 60, 18, 80, 12, ES_LEFT | WS_CHILD | WS_BORDER | WS_TABSTOP | WS_VISIBLE, WS_EX_WINDOWEDGE
EDITTEXT IDC_EDIT_2, 60, 34, 80, 12, ES_LEFT | WS_CHILD | WS_BORDER | WS_TABSTOP | WS_VISIBLE, WS_EX_WINDOWEDGE
CONTROL "Cancel", IDC_BUTTON_1, "BUTTON", BS_PUSHBUTTON | BS_VCENTER | BS_CENTER | WS_CHILD | WS_TABSTOP | WS_VISIBLE, 98, 112, 50, 14
CONTROL "Apply", IDC_BUTTON_2, "BUTTON", BS_PUSHBUTTON | BS_VCENTER | BS_CENTER | WS_CHILD | WS_TABSTOP | WS_VISIBLE, 42, 112, 50, 14
}
而你的WM_INITDIALOG哈勒是在哪裏?請添加代碼。 – user2120666
項之間的Tabbing由'IsDialogMessage()'函數處理。確保您爲每個彈出對話框調用它。 –