Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RADIO BOX CONTROL 1

Status
Not open for further replies.

paul51

Programmer
May 19, 2000
38
US
Does anyone know how to fill a radio box with a black mark. I know that it can be done in real time with the mouse, but I need to put it to a 'filled' state without user interaction.

Paul
 
Try:
Code:
CheckDlgButton(hDlg,ID_BUTTON_NAME,BST_CHECKED);

I hope this helps.

lhilliard
 
another option is to create a control using the class wizard and then set the control equal to true. i.e.
m_ctlRadioBtn = true;

HTH,
JC
 
How can I programmatically change attributes on dialog controls?
For instance enabling/disabling an edit box or radio button.
 
lhilliard got it! What an easy implementation to check a Radio Button. His referance to the function "CheckDlgButton(hDlg,ID_BUTTON_NAME,BST_CHECKED);" was the easiest to implement(at least for me). I stumbled thru all the SetCheck stuff and MFC Help with no success. I used the Dialog Editor the create a Radio button, then added a function called Hex which MFC turns into "void CPIODlg::OnHex()". In my "BOOL CPIODlg::OnInitDialog()" function I placed the line of code,
"CheckDlgButton(IDC_Hex, BST_CHECKED)". Now as soon as I run the app that radio button is checked. THANKS!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top