Firemonkey中的透明表格与样式簿 [英] Transparent Form in firemonkey with a stylebook
问题描述
我有一个包含多个样式簿的应用程序,其中包含来自delphistyles.com的样式.我想添加一个跟踪栏,以允许用户在运行时更改表单的透明度,就像在带有alphablend的VCL中一样.
I have a application with multiple stylebooks containing styles from delphistyles.com. I want to add a trackbar to allow the user to change the transparency of the form at runtime like you can do in VCL with alphablend.
这篇文章: FireMonkey中的AlphaBlend 说:
要使表单背景为半透明,应将表单的Transparency属性设置为true,并使用具有$ AAFFFFFF(with Fill.Kind = bkSolid)之类的alpha值的Fill.Color.在这种情况下,边框变得不可见(至少在Delphi XE2中如此)
To make your form background semitransparent you should set form Transparency property to true and use Fill.Color with alpha value like $AAFFFFFF(with Fill.Kind = bkSolid). in this case form border becomes invisible (at least in Delphi XE2)
但是,当我的表单中有样式簿时,该如何实现呢?
But how can I achieve this when my form has a stylebook?
推荐答案
- 将TForm.Transparency设置为True
- 使用Align = Content在表单上放置TPanel
- 将TPanel用作所有控件的约束
- 使用TPanel.Opacity增强透明度
这篇关于Firemonkey中的透明表格与样式簿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!