4

I'm creating an MSI package and I have the requirement to set the text of a CheckBox control to something like "this is my bold portion".

I tried something like:

this is my {\WixUI_Font_Bold}bold portion

but it doesn't work. Does anybody know if it's possible to do it without having to place 2 text controls one after the other?

Andreas
  • 5,393
  • 9
  • 44
  • 53
Andrea Vacondio
  • 888
  • 9
  • 19

1 Answers1

6

When you apply some style to the displayed text, you do this by prefixing the string with the style identifier, and it changes the look of entire text of the control. Obviously, you can't achieve this with Checkbox control on its own.

If it's a critical requirement, introduce 3 more Text controls, set the text of the first to "this is my", the text of the second to "{\WixUI_Font_Bold}bold" and the text of the last one to "portion". Align these Text controls into a line in front of the Checkbox, and blank out the Text property of the Checkbox. Thus, the Text controls will emulate the Text property of the Checkbox, and keep the desired formatting.

Honestly, this looks ugly, although technically possible. If you need to put so much efforts to accomplish such a small thing, it's better throw this idea away and live with what is there out of the box. You'll never make pure Windows Installer UI look and feel like a rich WPF app, so no reason to pretend you can :)

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139