简体   繁体   中英

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

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

在此处输入图像描述

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.

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

自定义结束对话框

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.

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:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM