This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Enabling dialog controls from checkbox
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 26, 2009
10:41 AM
Enabling dialog controls from checkbox
This is a pretty basic thing, but I'm having trouble figuring out how to do it. In a dialog I have a checkbox, and if it's checked I want a few edit text fields below to be enabled, otherwise disabled. I've been looking at the event and subscription behavior tables for the controls, but I'm not sure what to do. Thanks.
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 27, 2009
02:06 PM
I created a very similar method that allows that to be possible. Below is the code that is used to achieve the functionality.
Pass in the following parameters:
DialogName -- Name of the Dialog
ControlID -- ID of the controls you wish to manipulate
IsVisible -- true if you wish to enable the control; otherwise, false.
You can use CtrlGetState to get the state of the button and if it is equal to BUTTON_CHECKED then enable the controls.
Pass in the following parameters:
DialogName -- Name of the Dialog
ControlID -- ID of the controls you wish to manipulate
IsVisible -- true if you wish to enable the control; otherwise, false.
You can use CtrlGetState to get the state of the button and if it is equal to BUTTON_CHECKED then enable the controls.
if(CtrlGetState(DialogName, CheckBoxControl) = BUTTON_CHECKED) then
EnableItem(DialogName,..., true);
else
EnableItem(DialogName,..., false);
endif;
///=================================================================
///
/// Sets a value that indicates whether the windows control is
/// enabled.
///
///=================================================================
function EnableItem(sDialogName, nControlID, IsVisible)
HWND hDialog, hInstance;
begin
hDialog = CmdGetHwndDlg(sDialogName);
hInstance = GetDlgItem(hDialog, nControlID);
EnableWindow(hInstance, IsVisible);
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 28, 2009
04:27 AM
what type of project?