---
title: "SplitContainer Control in C#.Net"  
description: "A SplitContainer has two panels. The first panel is represented by Panel1 and the second panel is represented by Panel2.    These panels can have th"  
author: "John Smith"  
published: 2011-01-24  
updated: 2020-07-05  
canonical: https://www.mindstick.com/articles/402/splitcontainer-control-in-c-sharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# SplitContainer Control in C#.Net

A SplitContainer has two panels. The first panel is represented by Panel1 and the [second](https://yourviews.mindstick.com/view/82433/the-second-wave-new-covid-19-vs-old-covid-19) panel is represented by Panel2.\
These panels can have their own [properties](https://yourviews.mindstick.com/view/81845/now-it-s-possible-to-predict-properties-of-any-molecule) and events.\
**How to use SplitContainer [Control](https://yourviews.mindstick.com/view/83439/bipartisan-gun-control-bill-passed-in-us-after-decades)**\

[Drag and drop](https://www.mindstick.com/forum/454/how-to-drag-and-drop-multiple-image-from-one-canvas-to-onther-canvas-in-html5) SplitContainer control from [**the toolbox on the window Form.**](https://www.mindstick.com/interview/6/how-many-ways-to-deploy-an-assembly)

![SplitContainer Control in C#.Net](https://www.mindstick.com/mindstickarticle/9e977048-2e26-4a34-a6c5-8f9a0170f9b7/images/178136a8-7d72-4e56-b5a1-e71a7624bc1f.png)

You can use both panels as a separate panel.

## Properties of SplitContainer control:

- [Orientation](https://www.mindstick.com/interview/2604/what-is-orientation) - Gets or sets a value indicating the Horizontal or [Vertical](https://www.mindstick.com/forum/12951/how-to-fix-bootstrap-tab-vertical-with-text) orientation of the SplitContainer panels.
- BackgroundImage- Instead of a single color, an image can be displayed as the background. The image only appears in the splitter bar.

## Change color of Panel in SplitContainer

## Code:

```
private void frmSplitContainer_Load(object sender,  EventArgs e){            //change the color of panel1            splitContainer1.Panel1.BackColor = Color.Blue;            //change the color of panel2            splitContainer1.Panel2.BackColor = Color.DarkOliveGreen;  }
```

**Run the [project](https://yourviews.mindstick.com/story/1788/things-to-ensure-your-construction-project-is-successful)**

Backcolor of both panel in splitcontainer is different because both panels works as a separate panel in splitcontainer control.

![SplitContainer Control in C#.Net](https://www.mindstick.com/mindstickarticle/9e977048-2e26-4a34-a6c5-8f9a0170f9b7/images/fcf6ca49-ff51-46b1-ac90-a523874b7748.png)

**Collapse panel in splitcontainer**

You can collapse one panel out of two panels in SplitContainer.

Write the Code for collapse the Panel1 on form load

## Example:

```
private void frmSplitContainer_Load(object sender,  EventArgs e){            // Panel1 will be collapse at run time            splitContainer1.Panel1Collapsed = true;  }
```

Panel1 will be collapse when the [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) run.

## [Output](https://www.mindstick.com/interview/34427/explain-the-output-in-angular)

Panel1 is collapse.

![SplitContainer Control in C#.Net](https://www.mindstick.com/mindstickarticle/9e977048-2e26-4a34-a6c5-8f9a0170f9b7/images/ace46702-66ed-4790-aa97-b3f1c2236582.png)

---

Original Source: https://www.mindstick.com/articles/402/splitcontainer-control-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
