问题
I have a Panel on windows Form with few controls inside panel,
Can i make panel completely transparent.
(It should give the feel that controls are placed directly on Form)
回答1:
If you go to the BackColor property, and change the Selector to "Web" the first choice is Transparent (at least it is in my VB IDE). I believe that the BackColor of the Panel would inherit the color of the component it is on.
回答2:
I assume it is WinForms app.
Try this in Form.Load event:
private void Form1_Load_1(object sender, EventArgs e)
{
panel1.BackColor = Color.FromArgb(0, 0, 0, 0);
}
where panel1 is the panel you want to have transparent.
It will make the color transparent. You can have other controls on the panel.
来源:https://stackoverflow.com/questions/2722319/how-to-create-transparent-panel-in-c-net