Setting Dialog Tab Order With Propertysheet
-
I have a dialog box with various buttons and controls on it, as well as a static text box which is used as a placeholder, and in code it creates a propertysheet where the static text box is. I set my desired tab order, with the static text box as #13 in the tab order. But instead of tabbing off the #12 order (a button) and going to the propertysheet's active tab/page, it goes to the #14 control (a listview), then, at the end of the ta order sequence, ends up on the propertysheet. Is there a way I can set the tab order so that the tab order is properly set, so that the propertysheet is #13 in the tab order? Thanks!
-
I have a dialog box with various buttons and controls on it, as well as a static text box which is used as a placeholder, and in code it creates a propertysheet where the static text box is. I set my desired tab order, with the static text box as #13 in the tab order. But instead of tabbing off the #12 order (a button) and going to the propertysheet's active tab/page, it goes to the #14 control (a listview), then, at the end of the ta order sequence, ends up on the propertysheet. Is there a way I can set the tab order so that the tab order is properly set, so that the propertysheet is #13 in the tab order? Thanks!
Check out
CWnd::SetWindowPos()
- I think that might do the trick! -
Check out
CWnd::SetWindowPos()
- I think that might do the trick!I looked up SetWindowPos in MSDN, and tried a few things, but none of them affected the tab order from the dialog controls to the propertysheet, and the propertysheet is last in the tab order. Here is the code I use to create the propertysheet dynamically, IDC_PPS_MAIN is a dialog resource, m_ppsMain is a CPropertysheet object. This code is ran in a dialog in its OnInitDialog() function:
m_ppsMain.Create(this, WS_CHILD | WS_VISIBLE, 0); m_ppsMain.ModifyStyleEx(0, WS_EX_CONTROLPARENT); m_ppsMain.ModifyStyle(0, WS_TABSTOP); CRect rcSheet; GetDlgItem(IDC_PPS_MAIN)->GetWindowRect(&rcSheet); ScreenToClient(&rcSheet); m_ppsMain.SetWindowPos(NULL, rcSheet.left- 7, rcSheet.top - 7, 0, 0, SWP_NOZORDER | SWP_NOSIZE); // set all pages active once to avoid assertions m_ppsMain.SetActivePage(1); m_ppsMain.SetActivePage(2); m_ppsMain.SetActivePage(3); m_ppsMain.SetActivePage(4); m_ppsMain.SetActivePage(0);
-
I have a dialog box with various buttons and controls on it, as well as a static text box which is used as a placeholder, and in code it creates a propertysheet where the static text box is. I set my desired tab order, with the static text box as #13 in the tab order. But instead of tabbing off the #12 order (a button) and going to the propertysheet's active tab/page, it goes to the #14 control (a listview), then, at the end of the ta order sequence, ends up on the propertysheet. Is there a way I can set the tab order so that the tab order is properly set, so that the propertysheet is #13 in the tab order? Thanks!
Make sure that the property sheet/pages have the 'control' style set. This style (DS_CONTROL) tells Windows to include them in the tab order of their parent window.
Software Zen:
delete this;