Use of menustrip in desktop application c#

Menu(s) in desktop application c#

Hello friend, how are you? All is well?

Today we will learn how to add menu(s) in our windows(desktop) application. We will use our previous example in which we had learned how to use mdi parent form. The link is here: Introduction to mdi parent form in desktop application

Download the project and open it.

Now to add menus in desktop application we need to add menustrip control to the form. Follow the image.

add menustrip in mdi parent form
add menustrip in mdi parent form

As you can see the menustrip control is in Menus & Tollbars group control.

Now drag the menu control to the form or just double click the menustrip, it will added automatically. Now add some menus. See the example in the picture.

adding menus to the menustrip in desktop applications
adding menus to the menustrip in desktop applications

Now double click on open menu you just created and write down the following code.

private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show(“Hello!, You have clicked open menu”);
}

private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show(“Hello!, You have clicked Exit menu”);
}

Download the project menustrip in desktop application here

Happy coding……….

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Leave a Reply

Your email address will not be published. Required fields are marked *