First, dialog box
1. Pop-up dialog box for user to select OK, cancel
Dialogresult dr = Messigebox.show ("This shows the contents of the dialog box", "Here is the top title of the dialog box", Messigeboxbuttons.okcancel);
Messigeboxbuttons.okcancel: The popup dialog has two options, "OK" and "Cancel", others, such as "yes", "No", "Cancel";
Judgment: if (dr = = Delogresult.ok) {Determine if the dialog box chooses OK, if it is done here, if not ...}
2, ColorDialog: To provide a choice of color dialog box, the method and determine the cancellation of the same pop-up window;
Label1. BackColor = colordislog.color; color dialog box select the color to change the background color label1;
Label1. ForeColor = colordislog.color; color dialog box select the color to change the foreground color Label1;
Notepad:
Add a row of standard items, such as file, edit, tool, etc. drop-down box menu, and then use the TextBox Dock property Full screen, simple notepad look out;
3, Fontdelog: added in the Font drop-down menu, you can pop up a dialog box for the user to select the font, using and judging method and the same as above;
DialogResult dr = Fontdelog.showdelog ();
if (dr = = Delogresult.ok)
{
TextBox1. Font = Fontdelog1.font;
}
Not to be continued
C # Winform dialog box Controls & Simple Notepad