Dialogs in C#
Learn C# (C sharp) in FREE step-by-step lessons.
Dialogs in C#
Menus with Submenus; Toolstrip; Status Bar; Common Dialog controls for Font, Color, Open, Save; Message Box
In this lesson we will create the Happy Birthday application shown below:
As you can see in the illustration, this app has a menu, a tool strip, and a staus bar at the bottom.
It will use common dialog controls to select font, color and the picture to display.
You have seen many of the common dialog boxes in other applications.
You have probably seen the dialog box to select a font or color and have probably used the common dialog to open a file and save a file.
In order to do this you will:
- Be able to create a menu with submenus;
- Add event listeners for menu items;
- Add and work with a toolstrip on the form;
- Add and work with a status bar on the form;
- Be able to work with the Common Dialog Controls for Font, Color, Open, and Save;
- Be able to customize and display a message box.
Please study the material at each of the links below.
Microsoft Reference: C# Dialogs, Common Dialogs and Message Boxes
- Happy Birthday: This is an overview of the app that we will create in this lesson.
/csharp/videos/csharp-happy-birthday.mp4
- Create the menu for the Happy Birthday App: Shows how to build the menu for the Happy Birthday program.
/csharp/videos/csharp-menu.mp4
- Create the tool strip for the Happy Birthday App: Shows how to build the toolstrip (at the top of the form), plus two images to download
/csharp/videos/csharp-toolstrip.mp4
- Create the status strip for the Happy Birthday App: Create the status strip (at the bottom of the form) & add code to display the current time
/csharp/videos/csharp-statusstrip.mp4
- Add the font dialog for the Happy Birthday App: The font dialog is shown modal: Nothing else happens until the dialog closes.
/csharp/videos/csharp-fontdialog.mp4
- Adds the Open dialog to select a picture: Includes setting the filter to select only picture types.
/csharp/videos/csharp-openfile.mp4
- Add the Color dialog to select a background color for the Happy Birthday App: Includes a different way to determine if the user clicked cancel
/csharp/videos/csharp-colordialog.mp4
- Add the code for New and Exit: The last of the Happy Birthday App: Shows how to save and restore the form settings at start
/csharp/videos/csharp-new.mp4
- A Message Box Example: Explanation of using a message box.
- Message Box Buttons and Icons: In addition to OK, and YesNO, other buttons can be shown