Changing text colour when check box changes state - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Warrigal
Posts: 43
Joined: Thu Jun 26, 2008 8:20 am

Changing text colour when check box changes state

Is it possible to change the text style associated with a checkbox when it changes state?

I'm thinking of doing this because I have a custom dialog called ProductSelection that has a number of check boxes for feature selection instead of the default CustomizeDlg. One of our testers suggested that when you are doing a change during maintenance mode, the Next button should be disabled if you haven't changed the selection. I think I can do this okay, but I'm concerned about usability. If a user changes some check boxes, then changes them back to their original state, they may not realise that they're back in the original state and wonder why the Next button is disabled. I was thinking of changing the text colour of the check boxes to indicate which ones have changed state, e.g. black = not changed, blue = changed. If all are black, then the Next button is disabled.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Changing text colour when check box changes state

Hi,

I'm afraid that this is not supported by Windows Installer. The text style can be specified only before the package is built. Also, I'm not sure if what you need can be done.

A possible solution would be to use a custom action to verify the feature states (if they are installed or not) and the checkboxes which are checked. Based on the results, the custom action should set a property which conditions the "Next" button. However, this custom action should run every time a checkbox is checked or unchecked.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Warrigal
Posts: 43
Joined: Thu Jun 26, 2008 8:20 am

Re: Changing text colour when check box changes state

Thanks Cosmin. I suspected that would be the case.

I think I may have found a workaround, but it's a bit complicated and probably not worth the trouble.

Use a check box with no label. Add an adjacent label using a text widget in black. Add an identical text widget at the same position, but in (say) blue. Use control conditions to show and hide the appropriately coloured text widgets when the check box is changed. The initialisation conditions (in custom actions) and control conditions are complicated, but I think everything should work okay.
Warrigal
Posts: 43
Joined: Thu Jun 26, 2008 8:20 am

Re: Changing text colour when check box changes state

Some more thoughts for anyone else interested in this topic.

My workaround is less than desirable. You have to be very careful to make sure that both text strings have the same keyboard mnemonic and they come before the check box in the tab sequence. Once you've done this, when the check box is selected, the focus rectangle does not extend around the text widgets, as it normally would. Maybe you could fudge this with a string of spaces for the check box label, but this is all getting a bit messy. I think it's better to skip the idea of changing text colour for check box labels and tell the test team that it can't be done.

Return to “Common Problems”