Transparent Form in firemonkey with a stylebook

萝らか妹 提交于 2019-12-13 03:56:53

问题


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.

This post: AlphaBlend in FireMonkey says the following:

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:


  1. Set TForm.Transparency to True
  2. Put TPanel on the form with Align = Content
  3. Use your TPanel as conteiner for all controls
  4. Use TPanel.Opacity for transparency



回答2:


Another thing is when the main form is transparent how can I go about making a titlebar for the user to drag the form?

I use my own class TWindowMove for moving forms without titlebar. Thats a small demo project



来源:https://stackoverflow.com/questions/50551160/transparent-form-in-firemonkey-with-a-stylebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!