VB.NET Dialog Box
A Dialog box is a temporary Window for an application that accepts user response through mouse or keyboard to open a file, save a file, notifications, alert messages, color, print, openfile dialog box, etc. It is also useful to create communication and interaction between the user and the application. Furthermore, the dialog box appears in a form when the program needs to interact with users, such as when an error occurs, an alert message, acknowledgment from the user or when the program requires immediate action or whether the decision is to be saved based on the changes.
All VB.NET Dialog box inherits the CommonDialog class and overrides the RunDialog() method of the base class to create the OpenFileDialog box, PrintDialogbox, Color, and Font Dialog box. The RunDialog() method is automatically called in a Windows form when the dialog box calls its ShowDialog() method.
There are following functions of the ShowDialog() method that can be called at run time in the Windows Form.
There are the commonly used dialog box controls in the VB.NET Windows Form.
Let's create a simple program to display the dialog box in the VB.NET Windows Forms.
Now, click on the Click Me button of the Windows Form, it displays the dialog box, as shown below.