Search code examples
c#forms

creating about dialog box in C# form application


I have a C# form application, in that I have a menu where one of the item is help. It has a sub-item About. As you seen in many applications when you click on help a separate dialog box opens up which displays the information.

I want something like that.


Solution

  • To add a menu to a Windows Form at design time Open the form you wish to add a menu to in the Windows Forms Designer.

    • In the Toolbox, double-click the MenuStrip component.
    • A menu is added to the form (displaying the text "Type Here"), and the MainMenu component is added to the component tray.

    Then you can do that as follows using click Event of that particuler subMenu item . Hint:Just click the subMenu item and rightclick->Properties..then you can find the Click Event for subMenuItem.

     private void aboutToolStripMenuItem1_Click(object sender, EventArgs e)
     {
        AboutWindow aboutWindow = new AboutWindow();
        aboutWindow.Show();
     }