DS_CONTROL vs WS_EX_CONTROLPARENT
-
Hi, What is the difference between DS_CONTROL and WS_EX_CONTROLPARENT? I know DS_CONTROL will remove the WS_CAPTION and WS_SYSMENU styles from the dialog. But I dont know if any other differences are there. Thanks in advance.
- NS -
Off memory, DS_CONTROL style governs what happens when you reach the end of the tab order of controls in a dialog. If it's not set, the tab order will wrap around. If it *is* set, the tab will pass to a window governed by the dialogs parent window. The documentation for WS_EX_CONTROLPARENT pretty much tells a normal window to do the tab order thing for it's children. I bet if you look at a normal dialog using spy++ you will see this bit is set. Iain.
-
Off memory, DS_CONTROL style governs what happens when you reach the end of the tab order of controls in a dialog. If it's not set, the tab order will wrap around. If it *is* set, the tab will pass to a window governed by the dialogs parent window. The documentation for WS_EX_CONTROLPARENT pretty much tells a normal window to do the tab order thing for it's children. I bet if you look at a normal dialog using spy++ you will see this bit is set. Iain.
But I am very much confused with this DS_CONTROL I have a dialog havning two buttons. And another dialog with two edit boxes. And in the OnInitDialog I have as follows. m_dlgctrl.Create( m_dlgctrl.IDD, this ); ModifyStyleEx( 0, WS_EX_CONTROLPARENT ); m_dlgctrl.ModifyStyleEx( 0, WS_EX_CONTROLPARENT ); m_dlgctrl.ModifyStyle( DS_CONTROL, 0 ); Now the child dialog has no DS_CONTROL. But the tab order quite fine. This proves that DS_CONTROL has no influence in tab setting?
- NS -
-
But I am very much confused with this DS_CONTROL I have a dialog havning two buttons. And another dialog with two edit boxes. And in the OnInitDialog I have as follows. m_dlgctrl.Create( m_dlgctrl.IDD, this ); ModifyStyleEx( 0, WS_EX_CONTROLPARENT ); m_dlgctrl.ModifyStyleEx( 0, WS_EX_CONTROLPARENT ); m_dlgctrl.ModifyStyle( DS_CONTROL, 0 ); Now the child dialog has no DS_CONTROL. But the tab order quite fine. This proves that DS_CONTROL has no influence in tab setting?
- NS -
I can do no better than to point to the explanation on Raymond Chen's blog (one of the first few google results for DS_CONTROL, by the way... http://blogs.msdn.com/oldnewthing/archive/2004/07/30/201988.aspx[^] "When you set the DS_CONTROL style on a dialog template (or set the WS_EX_CONTROLPARENT extended style on a regular window), a bunch of new rules kick in." I hope his article can help! Iain.
-
I can do no better than to point to the explanation on Raymond Chen's blog (one of the first few google results for DS_CONTROL, by the way... http://blogs.msdn.com/oldnewthing/archive/2004/07/30/201988.aspx[^] "When you set the DS_CONTROL style on a dialog template (or set the WS_EX_CONTROLPARENT extended style on a regular window), a bunch of new rules kick in." I hope his article can help! Iain.