---
title: "ToolStrip Control in C#.Net"  
description: "ToolStrip is a container for ToolStripItem elements. Each individual element on the ToolStrip is a ToolStripItem that manages the layout and event mod"  
author: "Pushpendra Singh"  
published: 2011-01-24  
updated: 2020-09-03  
canonical: https://www.mindstick.com/articles/415/toolstrip-control-in-c-sharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# ToolStrip Control in C#.Net

ToolStrip is a [container](https://www.mindstick.com/forum/34127/extjs-how-to-set-border-for-the-container) for ToolStripItem elements. Each individual element on the ToolStrip is a ToolStripItem that manages the layout and event model for the type it contains. The ToolStrip [controls](https://www.mindstick.com/articles/66/how-to-create-controls-at-run-time-in-csharp-dot-net) provide a [common](https://yourviews.mindstick.com/story/1215/the-most-common-sexually-transmitted-infections) [interface](https://www.mindstick.com/articles/12036/interface-in-c-sharp) for Menus and Strips in [Windows](https://www.mindstick.com/articles/12793/insightful-review-of-stellar-phoenix-windows-data-recovery-home-edition) Forms.\

**How to use ToolStrip [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) ToolStrip Control from toolbox on the [window Form](https://www.mindstick.com/forum/527/how-to-pass-datagridview-s-cells-value-to-another-window-form).

![ToolStrip Control in C#.Net](https://www.mindstick.com/mindstickarticle/d6499d67-c7e7-4012-8ce1-6e2256397310/images/083bd9ed-9c9b-4fd9-acef-42d27762d0f8.png)

![ToolStrip Control in C#.Net](https://www.mindstick.com/mindstickarticle/d6499d67-c7e7-4012-8ce1-6e2256397310/images/38efe497-393d-44dc-a405-785ff5307202.png)

Add ToolStrip Item which you want to show. Add one of the items in your ToolStrip that derives from ToolStrip Item.

You can also add [standard](https://www.mindstick.com/articles/23223/naming-convention-or-coding-standard) item through smart tag.

![ToolStrip Control in C#.Net](https://www.mindstick.com/mindstickarticle/d6499d67-c7e7-4012-8ce1-6e2256397310/images/cd4e6c08-ea4e-4345-9568-b06d53f3de19.png)

![ToolStrip Control in C#.Net](https://www.mindstick.com/mindstickarticle/d6499d67-c7e7-4012-8ce1-6e2256397310/images/d5333126-e279-4615-9d10-872148301aab.png)

Here SplitButton is added

Enter text which you want to show as Menu.

![ToolStrip Control in C#.Net](https://www.mindstick.com/mindstickarticle/d6499d67-c7e7-4012-8ce1-6e2256397310/images/060776fd-0b9b-4c5d-9498-2e186b56a8aa.png)

Create event handlers for the above menu items (**New, Open, Save, Exit**) on the MenuStrip through **double click** on them.

```
private void newToolStripMenuItem_Click(object sender,  EventArgs e){}private void saveToolStripMenuItem_Click(object sender,  EventArgs e){}private void saveToolStripMenuItem1_Click(object sender,  EventArgs e){}private void exitToolStripMenuItem_Click(object sender,  EventArgs e){}
```

**Change the Form to an MDI Form.**

```
private void frmToolStrip_Load(object sender, EventArgs e){            this.IsMdiContainer = true;        }
```

Write code on the Click event of the **New menu** item.

```
private void newToolStripMenuItem_Click(object sender,  EventArgs e){            Form frm =  new Form();            frm.MdiParent = this;            frm.Text = "New";            frm.Show();}
```

**Run the project**

![ToolStrip Control in C#.Net](https://www.mindstick.com/mindstickarticle/d6499d67-c7e7-4012-8ce1-6e2256397310/images/92b98cf0-3efe-476f-a7a7-3240eb0634a6.png)

New child Form will open when New [menu item](https://www.mindstick.com/forum/339/highlighting-the-menu-item) clicked.

![ToolStrip Control in C#.Net](https://www.mindstick.com/mindstickarticle/d6499d67-c7e7-4012-8ce1-6e2256397310/images/b8ee45d2-fffc-4b65-85cd-43259f59bd05.png)

Write code on the Click event of the **Open menu item**.

```
private void openToolStripMenuItem_Click(object sender,  EventArgs e){            OpenFileDialog ofd = new OpenFileDialog();            ofd.ShowDialog();}
```

OpenFileDialog will open when Open menu item clicked.

Write code on the Click event of the **Save menu** item.

```
private void saveToolStripMenuItem1_Click(object sender,  EventArgs e){            SaveFileDialog sfd = new SaveFileDialog();           // open savefile dialog            sfd.ShowDialog();}
```

SaveFileDialog will open when Save menuitem clicked.

Write code on the Click event of the **Exit menu** item.

```
private void exitToolStripMenuItem_Click(object sender,  EventArgs e){            // close the window            this.Close();}
```

## ToolStrip Properties

**Size:**Set the height and width of the control.

**Text:** Set the text associated with this control.

**RenderMode:** Set a value that indicates which visual styles will be applied to the ToolStrip.

**LayoutStyle:** Set a value indicating how the ToolStrip lays out the items collection.

---

Original Source: https://www.mindstick.com/articles/415/toolstrip-control-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
