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.
Asked
Active
Viewed 320 times
-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 Answers
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
-
This and the other answer won't work, cause then the border of the panel will be hidden from view – Gaurav Mall Mar 08 '20 at 11:51
-
Yeah but why would he add it on the border? It's completely useless, and the border does NOT show when launching the program. – ShiningLea Mar 08 '20 at 11:59
-
If he doesn't want the border, then you should have labeled this question as a duplicate, because the answer already exists. – Gaurav Mall Mar 08 '20 at 12:01
-
Well, I didn't know that the answer already existed, sorry. Next time I'll search more. – ShiningLea Mar 08 '20 at 12:05
-
No need to ask sorry and I didn't mean any insult. You're new here and everybody makes mistakes. Just advising. – Gaurav Mall Mar 08 '20 at 12:07