delphibackgroundtransparencytmstms-web-core

How do I give a transparent background color for TWebPanel?


As the title states. I want to have a transparent TWebPanel component, meaning only the border should be visible.

So I've made a simple form with an image and a panel:

enter image description here

I want to be able to see the image behind the panel. Here's what I've tried:


What are my options? How can I make the background of the panel transparent?


Solution

  • Ah. I found out you can assign the gcNull or clNone value to the Color property on the panel. That makes it transparent:

    TMS Web Project with image and panel

    Do note though that in design-time, it looks black when the gcNull value is assigned to Color:

    Delphi TWebPanel

    But rest assured that in run-time, it is definitely transparent and not black.


    And if you want the border to be transparent also, then you can just set the BorderStyle property to bsNone.