---
title: "Panel Control in C#.Net"  
description: "The Panel control is similar to the GroupBox control; however, only the Panel control can have scroll bars, and only the GroupBox control displays a c"  
author: "Pushpendra Singh"  
published: 2011-01-24  
updated: 2020-08-28  
canonical: https://www.mindstick.com/articles/400/panel-control-in-c-sharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Panel Control in C#.Net

The Panel control is similar to the GroupBox control; however, only the Panel control can have scroll bars, and only the GroupBox control displays a caption.\

##### How to use Panel Control

Drag and drop Panel control from toolbox on the window Form.

![Panel Control in C#.Net](https://www.mindstick.com/mindstickarticle/40c0bca6-c507-483e-8ea8-d0423d727697/images/18a9f8a1-09a9-4e0d-b8fa-2e9f7a3aa15c.png)\

Collection of control can be placed in side Panel.

![Panel Control in C#.Net](https://www.mindstick.com/mindstickarticle/40c0bca6-c507-483e-8ea8-d0423d727697/images/a232a178-c806-44b9-83fe-b6f6307a9593.png)\

##### Transparent Panel

First set BackColor of Panel suppose you set red then set Form's TransparencyKey property to the same color as Panel's background color –red in this case.

\

**Example:**

```
 private void frmPanel_Load(object sender, EventArgs e){   //change back color of Panel   panel1.BackColor = Color.Red;   //set Form's TransparencyKey to the same color as Panel's back color   this.TransparencyKey= Color.Red;}  
```

\

Now panel will be transparent when application run.

![Panel Control in C#.Net](https://www.mindstick.com/mindstickarticle/40c0bca6-c507-483e-8ea8-d0423d727697/images/ca7d8754-fead-4f6a-9557-2109b5acadd9.png)

##### \

##### Panel Properties

BackColor: Panel BackColor can be changed through BackColor property.

##### Example:

```
private void frmPanel_Load(object sender, EventArgs e){    //change back color of
Panel    panel1.BackColor = Color.CadetBlue;}
```

##### Output:

![Panel Control in C#.Net](https://www.mindstick.com/mindstickarticle/40c0bca6-c507-483e-8ea8-d0423d727697/images/18505faa-ca88-4e95-a3ad-f4cdf8698f33.png)

##### BorderStyle: Get or set BorderStyle of Panel.

\

**Example:**

```
private void frmPanel_Load(object sender, EventArgs e){        //Set
Border style of Panel        panel1.BorderStyle = BorderStyle.Fixed3D;}
```

## \

## Output

**\**

![Panel Control in C#.Net](https://www.mindstick.com/mindstickarticle/40c0bca6-c507-483e-8ea8-d0423d727697/images/49a9dbf9-119a-4fc7-9a13-01fd80103ca9.png)

Visible: You can hide all control inside panel through visible property of Panel. If

\

you want to hide then set visible to false.

\

## Example:

**\**

```
private void frmPanel_Load(object sender, EventArgs e){         //hide panel           panel1.Visible
= false;}
```

\

Now when application run then Panel will not show.

##### Output

![Panel Control in C#.Net](https://www.mindstick.com/mindstickarticle/40c0bca6-c507-483e-8ea8-d0423d727697/images/95c3a578-8964-45ae-a758-9ea068f1d471.png)

\

---

Original Source: https://www.mindstick.com/articles/400/panel-control-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
