I have a propertysheet with several pages in the application I am working with. The problem is that I can not disable/remove the "default" property for the default button on some of the pages (I do not want any of the buttons on the property pages to be default buttons since the default button is defined in the properysheet for all pages). It seems that when there is only one button on the page, that buttons is made the default button automatically.
If I look in the resource editor, the "default" property is NOT checked for any of the buttons. I have even tried the code snippet below to remove the "default" property if it is set but nothing seems to work.

In CPropertyPage::OnSetActive()

pBtn = (CButton*) this->GetDlgItem(IDC_BTN);
if(pBtn)
{
ulStyle = pBtn->GetButtonStyle();
if(ulStyle & BS_DEFPUSHBUTTON)
ulStyle -= BS_DEFPUSHBUTTON;
pBtn->SetButtonStyle(ulStyle, TRUE);
}

dwID = this->GetDefID();
wDefID = LOWORD(dwID);
wHasDefID = HIWORD(dwID);
if(wHasDefID == DC_HASDEFID && wDefID != 0)
{
// Remove current default button
CWnd* pWnd = this->GetDlgItem(wDefID);
if(pWnd)
{
ulStyle = ((CButton*)pWnd)->GetButtonStyle();
ulStyle -= BS_DEFPUSHBUTTON;
((CButton*)pWnd)->SetButtonStyle(ulStyle, TRUE);
}
}




Any ideas anyone???

/Mike