How can I make the background of an checkbox transparent in wix?
Asked Answered
T

3

6

How can I make the background of the checkbox transparent or white?

enter image description here

Tynishatynwald answered 2/7, 2015 at 7:56 Comment(1)
Added an answer with a proposed example. There could be side-effects to this approach as well.Haugen
N
4

That is quite common complaint. The quick answer is - no, there's no way to do it nicely. Let me quote the WiX Toolset tutorial:

And a common complaint: no, the checkbox can't have a transparent background. If you have a bitmap in the background, it will be ugly, just like in our example above. The only workaround is to reduce the width of the checkbox to the actual box itself and to place an additional static text (these can be made transparent) adjacent to it.

The downside of the workaround described is you won't be able to click the text in the label to check/uncheck the checkbox. You'll have to click directly into the control.

There is, however, one more (even uglier?) workaround: design the final dialog the way to have default grey area to place the checkbox on.

Newly answered 2/7, 2015 at 11:29 Comment(5)
Sad but true. And yeah, second workaround is even uglier.Darbydarce
A third workaround shown in my answer. Essentially: use a customized end dialog with a small bitmap in top left corner to avoid filling the whole dialog with a large bitmap with white background (which does not match the actual dialog background color of gray - in the normal case).Haugen
I see the last comment means that you think this is a worse workaround Yan?Haugen
@SteinÅsmul Not necessarily. Perhaps, I meant it to be uglier for the theme used by the topic starter (don't remember for sure, 5 years have passed :)). If it fits the overall theme of the installation UI, I think this is perfectly fine.Newly
I like that it should not disrupt any "screen readers" and features like that (for blind computer users - as indicated in the WiX documentation), but I am sure there are some other side effects from this approach as well.Haugen
T
2

A workaround I have used is to create a new version of the built-in WiX dialog set "Mondo" where I modify the end dialog to contain a much smaller picture which does not cover the whole dialog surface. This should allow the natural background color - normally gray - to fill the rest of the dialog. Screenshot below:

https://github.com/glytzhkof/WiXOpenLogFile

Customized end dialog

There could be side-effects, but this should allow the dialog's background color to fill the dialog properly:

Main wxs file snippet:

<Binary Id="MyOwnExitBitmap" SourceFile="myOwnExit.bmp" />

Dialog wxs file snippet:

<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="70" Height="70" TabSkip="no" Text="MyOwnExitBitmap" />

See full example above on github.com.

Tyrr answered 12/11, 2020 at 9:52 Comment(0)
P
0

Not a direct answer but just another workaround that can be ok in some cases. If that's just one checkbox like launch app/readme/whatever - then it can be placed to the buttons panel which has the same background:

enter image description here

Provolone answered 12/1, 2023 at 22:0 Comment(2)
How do you achieve this?Chimere
@Chimere it is the same <Control Type="CheckBox" .. /> like in the question. The trick is in its position - its Y attribute is close to the Height of the Dialog it belongs to. So it is drawn in the gray area and there is no need to change its backround.Provolone

© 2022 - 2024 — McMap. All rights reserved.