如何在 wix 中使复选框的背景透明?

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

如何将复选框的背景设置为透明或白色?

这是很常见的抱怨。快速的回答是 - 不,没有办法很好地做到这一点。让我引用 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.

所述解决方法的缺点是您将无法单击标签中的文本以 check/uncheck 复选框。您必须直接单击进入控件。

但是,还有一个(甚至更丑陋?)解决方法:将最终对话框设计为具有用于放置复选框的默认灰色区域。

我使用的解决方法是创建新版本的内置 WiX 对话框集“Mondo”,我在其中修改结束对话框以包含一个小得多的图片,不会覆盖整个对话框表面。这应该允许自然背景颜色 - 通常是灰色 - 填充对话框的其余部分。截图如下:

https://github.com/glytzhkof/WiXOpenLogFile

可能会有副作用,但这应该允许对话框的背景颜色正确填充对话框:

主要 wxs 文件片段:

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

对话框 wxs 文件片段:

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

请参阅上面 github.com 上的完整示例。