Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Transparent panel in c#.Net

Tags:

c#

panel

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)

like image 367
Gaddigesh Avatar asked Apr 27 '10 15:04

Gaddigesh


2 Answers

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.

like image 75
Jeremy Avatar answered Oct 15 '22 14:10

Jeremy


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.

like image 42
user218447 Avatar answered Oct 15 '22 16:10

user218447