I have got some radio buttons grouped in my dialog box. I want to make them read only (i.e they should not be checked).
Printable View
I have got some radio buttons grouped in my dialog box. I want to make them read only (i.e they should not be checked).
Hi,
I think all you have to do is to click on the "disabled" checkbox corresponding to that radio button.
Actaully,I want to do it programmatically.
Then use ::EnableWindow () to do it.
Sir, I dont understand how will it work? I read the Help, it says its used for entire dialog box. I want to enable or disable a particular radio button programmatically.
Hi:
You should get the handle of the radio-button from the
control's ID (for example, IDC_RADIO1), by using this API :
HWND hRadio1 = GetDlgItem (hDlg, IDC_RADIO1) ;
And then, you can use EnableWindow () like this :
EnableWindow (hRadio1, FALSE) ;
And the radio button will be disabled and grayed.
For simple, you can just write your code like this :
EnableWindow (GetDlgItem (hDlg, IDC_RADIO1), FALSE) ;
Bye
Best Regards !
-- Dang --
Hi,
Try this:
GetDlgItem(IDC_RADIO)->EnableWindow(FALSE);
Hope that works.
Chao
Thanks its working fine. Actually your help came right on time. Atleast two hours before my demo.
Zulfi.