C # Winform dialog box Controls & Simple Notepad

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.