WinForm Notepad Programming section

Source: Internet
Author: User
Tags print object

Textbox:

Property:

Text: Literal

SelectedText: Gets or sets the selected text

CanUndo: Is it possible to revoke

Method:

Undo: Undo

Clearundo: emptying the undo buffer

Cut: Cut

Copy: Copying

Paste: Pasting

SelectAll: Select All

dialog box: ShowDialog (); Displays a dialog box that returns an enumeration type of DialogResult

Colordialog:color property, used to get the color

Folderbrowserdialog:selectedpath Selected Path

The Fontdialog:font property returns a font type value that stores the settings for the font

Openfiledialog:filename Gets or sets the file path that contains the filename

Filenames is an array of file path strings

Filter: File filter format is hint text one |*. suffix | hint text two |*. suffix | hint text three |*. suffix

Savefiledialog1:filename Gets or sets the file path that contains the filename

Filenames is an array of file path strings

Filter: File filter format is hint text one |*. suffix | hint text two |*. suffix | hint text three |*. suffix

Stream:   Input stream:    string filename = openfiledialog1.filename;               //Read through the stream for file reading                 StreamReader sr = new StreamReader ( filename);                TextBox1.Text = Sr. ReadToEnd ();                Sr. Close ();   Output stream:      string filename = savefiledialog1.filename;                     //write stream, you can create a file on your hard disk, and write information to the file                      StreamWriter sw = new StreamWriter (filename);                     SW. Write (This.textBox1.Text);                      SW. Close ();  this: The current object that represents the class in which it resides

Print: Print Dialog: PrintDialog Page setup: PageSetupDialog Both dialogs need to be set PrintDocument to specify the print object PrintDocument: The object must be printed, a piece of artboard,   Used to relay between the printer and the printed content, the printer prints a printdoment printdocument1_printpage: event, which is triggered before each page is printed, and is used to give PrintDocument the specified print content to the page of the printed object through the artboard:             System.Drawing.Font f = new System.Drawing.Font ("Arial", 12);  E.graphics.drawstring (textbox1.text,f,system.drawing.brushes.aqua,5,5); Last Print: Print dialog box, if the print dialog returns to confirm printing, execute printdocument.print ();

WinForm Notepad Programming section

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.