Firemonkey中的透明表格与样式簿 [英] Transparent Form in firemonkey with a stylebook

查看:143
本文介绍了Firemonkey中的透明表格与样式簿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含多个样式簿的应用程序,其中包含来自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?

推荐答案

  1. 将TForm.Transparency设置为True
  2. 使用Align = Content在表单上放置TPanel
  3. 将TPanel用作所有控件的约束
  4. 使用TPanel.Opacity增强透明度

这篇关于Firemonkey中的透明表格与样式簿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆