CPropertyPage and default button behavior
-
Hello, i have a PropertySheet with PropertyPages. If there is no button in a page the "OK"-button of the sheet is the default button. Otherwise the first button in the page will automatically become the default button (none of the buttons in the page has the def-btn-style). My client want me to set always the "OK"-button of the sheet as default button. So i tried SetDefID(IDOK) in the OnInitDialog-handler of the page. But it had no effect. Is there an easy way to prevent the default behavior of the sheet or must i overwrite the WndProc() of the sheet or page and catch the message where the first button in the page is set do default? Best regards, Tabor25
-
Hello, i have a PropertySheet with PropertyPages. If there is no button in a page the "OK"-button of the sheet is the default button. Otherwise the first button in the page will automatically become the default button (none of the buttons in the page has the def-btn-style). My client want me to set always the "OK"-button of the sheet as default button. So i tried SetDefID(IDOK) in the OnInitDialog-handler of the page. But it had no effect. Is there an easy way to prevent the default behavior of the sheet or must i overwrite the WndProc() of the sheet or page and catch the message where the first button in the page is set do default? Best regards, Tabor25
Well, SetDefID(IDOK) wasn't going to work, as the OK button isn't actually *on* the page - its off it. Maybe GetParent ()->SetDefID(IDOK) ? Or try setting focus to the OK button? Iain.