In the application I am working on, I am having an interesting problem.
When I enter the dialog, the first radio button in the tab order is
automatically checked. One of the screens has 3 radio buttons, and only 3.
They are not grouped, nor do they have the tab order hint set. The dialog
is a popup style modeless dialog.
BOOL man2::OnInitDialog()
{ CDialog::OnInitDialog();
CRect r2; //the button is not set!!!
main_dlg->GetDlgItem(IDC_GENERAL)->GetWindowRect(&r2);// get size IDC_GENERAL
// Set prog window right on top of IDC_GENERAL area of screen, and show it
SetParent( main_dlg->GetDlgItem(IDC_GENERAL)); // IDC_GENERAL set 2 parent window
//the button is set, for some unknow reason the first push button in the
// tab order has been activated!!!
SetWindowPos( &main_dlg->wndTop,0,0,r2.Width(), r2.Height(), SWP_SHOWWINDOW);
return TRUE; // return TRUE unless you set the focus to a control
}
This does not cause any problems if the first tab order item is a static
text box rather then a control. Currently I fix this problem in this way, however
I am looking for answers on this one. I am not happy with this Hack. I don't think
the answer is as easy as tab order or group setting. It is not the default behavior of the
radiobutton.
Asher
When I enter the dialog, the first radio button in the tab order is
automatically checked. One of the screens has 3 radio buttons, and only 3.
They are not grouped, nor do they have the tab order hint set. The dialog
is a popup style modeless dialog.
BOOL man2::OnInitDialog()
{ CDialog::OnInitDialog();
CRect r2; //the button is not set!!!
main_dlg->GetDlgItem(IDC_GENERAL)->GetWindowRect(&r2);// get size IDC_GENERAL
// Set prog window right on top of IDC_GENERAL area of screen, and show it
SetParent( main_dlg->GetDlgItem(IDC_GENERAL)); // IDC_GENERAL set 2 parent window
//the button is set, for some unknow reason the first push button in the
// tab order has been activated!!!
SetWindowPos( &main_dlg->wndTop,0,0,r2.Width(), r2.Height(), SWP_SHOWWINDOW);
return TRUE; // return TRUE unless you set the focus to a control
}
This does not cause any problems if the first tab order item is a static
text box rather then a control. Currently I fix this problem in this way, however
I am looking for answers on this one. I am not happy with this Hack. I don't think
the answer is as easy as tab order or group setting. It is not the default behavior of the
radiobutton.
Asher