I created a control by code in the OnInitDialog, but i cannot find any way to change the tab order of the dialog by code.
Anyone have any idea on how to do this?
use ctrl+d on resource view in visual studio. and change tab order
An easier solution is change the sequence of controls in .rc file...that will change your tab order and z order both.
For Eg.
this dialog will have Tab Order IDOK
first, then IDCANCEL
IDD_ABOUT DIALOG DISCARDABLE 0, 0, 239, 66 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "My About Box" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "&OK",IDOK,174,18,50,14 PUSHBUTTON "&Cancel",IDCANCEL,174,35,50,14 END
now if you change it to
IDD_ABOUT DIALOG DISCARDABLE 0, 0, 239, 66 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "My About Box" FONT 8, "MS Sans Serif" BEGIN PUSHBUTTON "&Cancel",IDCANCEL,174,35,50,14 DEFPUSHBUTTON "&OK",IDOK,174,18,50,14 END
This will have Tab Order IDCANCEL
first then IDOK
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With