-2

How can I make a label transparent on all the panels I have? I couldn't find any solution for it when searching on Google, also the Transparent color won't make it transparent on all panels.

The label

Gaurav Mall
  • 2,372
  • 1
  • 17
  • 33
SpeeX
  • 11
  • 2
  • Labels are transparent by default, but transparency will only work when the control is __nested__. If it instead it __overlaps__ it will not work. – TaW Mar 08 '20 at 12:01
  • Does this answer your question? [How to do a background for a label will be without color?](https://stackoverflow.com/questions/4639482/how-to-do-a-background-for-a-label-will-be-without-color) – Gaurav Mall Mar 08 '20 at 12:01

2 Answers2

0
label.BackColor = Color.Transparent;

or you can set it to same color as the parent .

But you will probably get some problems with transparency ... since it's winform ..

0 x 5 4 4 D
  • 177
  • 1
  • 13
0

This one is tricky and got me several times. What you can do is update the label's back color to the panel's one like this :

private void UpdateBackColor()
{
  label1.BackColor = panel1.BackColor;
}

This will set the label color the same as your panel color, essentially solving your problem.

Gaurav Mall
  • 2,372
  • 1
  • 17
  • 33
ShiningLea
  • 132
  • 1
  • 12