VB. Net - Dialogs
Vb.net basic tutorial
VB.Net - Dialogs
There are many built-in dialogs to use in Windows Forms for
All of these dialog control classes inherit from the CommonDialog class and replace the RunDialog () function of the base class to create the box specific dialogue.
The RunDialog () function is automatically invoked when a dialog user calls their ShowDialog () function.
The ShowDialog method is used to display all of the dialog box controls at run time. It returns a value of the DialogResult enumeration type. Thes DialogResult enumeration values are -
Abort - returns the DialogResult.Abort value, when the user clicks an Abort button.
Cancel - returns DialogResult.Cancel, when the user clicks a Cancel button.
Ignore - returns DialogResult.Ignore, when the user clicks an Ignore button.
No - returns DialogResult.No, when the user clicks a No button.
None - returns nothing and the dialog continues to work.
OK - returns DialogResult.OK, when the user clicks an OK button
Retry - returns DialogResult.Retry, when the user clicks a Retry button
Yes - returns DialogResult.Yes, when the user clicks a Yes button
The following diagramshows common dialog class inheritance -
All of the above The e-mentioned classes have corresponding controls that can be added from the toolbox during design. You can include them Relevant functionality of these classes for you to apply, either by instantiating the class programmatically or by using the appropriate controls.
When you double-click one of the toolbox controls or Drag the control onto the form, it appears in the component bar at the bottom of Windows Forms Designer, they do not appear directly on the form.
The following table lists the box controls commonly used dialog. Click on the following links to check their details -
| Sr.No. || Control and deion |
| 1 || |
It represents a common dialog that displays the available colors with commands that allow the user to define custom colors.
| 2 || |
It prompts the user to choose a font from those installed on the local computer and allows the user to select the font, font size and color.
| 3 || |
It invites the user to open a file and allows him to select a file to open.
| 4 || |
It prompts the user to select a location to save a file and allows him to specify the name of the file to save the data.
| 5 || |
It allows user to print documents by selecting a printer and choosing the sections of the document to print from a Windows Forms application.