enabling/disabling checkboxes

enabling/disabling checkboxes

How do I enable/disable checkboxes by using the handle for the concerned dialog box i.e not using the dlgset function.
I want to obtain the same functionality as
dlgset(dlg,IDC_checkbox,.false.,dlg_enable )
using hdlg instead of dlg.The BM_SETCHECK and BM_SETSTATE functions succeed in greying out the check box but not in disabling them.
I'd like to know how I can totally disable and grey out a check box.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Checkbox is a window as any else. Use GetDlgItem to retrieve its handle, and then you can do with it whatever you can do with a window:

i = EnableWindow(GetDlgItem(hDlg,IDC_CHECKBOX), .FALSE.)

(Cf. ShowWindow(GetDlgItem(hDlg,IDC_CHECKBOX), SW_HIDE), MoveWindow, etc.)


Leave a Comment

Please sign in to add a comment. Not a member? Join today