C # The background color of the label control is Transparent.
C # The background color of the label control is changed to Transparent or Transparent. The label control is followed by picturebox. You need to set it first and then add it to the parent control. If it has already been added to the parent control, if it is set to transparent, it is invalid.
Label1.Parent = Picturebox1
Label1.BackColor = Color. Transparent
Label1.Parent = Picturebox1
This statement can be written in the code. It cannot be implemented during design ....
The control does not have a parent by default, especially when it is easy for new users who use IDE to fall into the trap. Dragging a widget into the form will not help you set parent.
Another trap is probably written as canvas1.Parent = this. Because this is a form, and the default background color of the form is gray, the background color of the control is gray in this way, it looks like it has no effect, but if you change the form to blue, the background color of the control is blue. If a newbie cannot figure out the framework structure of the form
Canvas1.Parent = pictureBox1;
Canvas1.BackColor = Color. Transparent;
Canvas1.CanvasImage = new Bitmap ("");
PS tutorial. At last, we found that canvas1.BackColor = Color. Transparent is not required. The default
Canvas1.Parent = pictureBox1;
Canvas1.CanvasImage = new Bitmap ("");
In addition, parent is the father, Transparent is the color set by the parent control, it's that simple
Almost all people on the Internet use this method BackColor = Color. Transparent, which is always unsuccessful at the beginning.