c#_ layouts, container controls, Print controls, dialog box controls

Source: Internet
Author: User
Tags print object save file

Layout:
      Anchor: Lock Position
Dock: Fill Location
              ---| The general dock is used in conjunction with container controls |---

Container controls:

Panel: is a region, similar to a div, can be individually laid out, and allows other controls and containers to be laid out inside it again

FlowLayoutPanel: Streaming layout container, the content will default from left to right, if the width is not enough, then wrap the line

GroupBox: still a container, with all panel properties, more headings and border styles than panel

TabControl: tab Container

SplitContainer: two partition container

TableLayoutPanel: table Container

Print Controls:

PrintDocument: The object to be printed, very important The program does not know what you want to print, it will only go to the object to be printed you have to do, is to print the content to draw to this print object up

PageSetupDialog: Print Setup dialog box

PrintPreviewControl: Print Preview control PrintPreviewDialog: Print Preview dialog box

PrintDialog: Print dialog box

  DialogResult specifies an identifier to indicate the return value of the dialog box.  
Namespaces: System.Windows.Forms

Assembly: System.Windows.Forms (in System.Windows.Forms.dll)

DialogResult: is an enumeration class that can be instantiated to receive user actions in a dialog box

DialogResult dr = Printdialog1.showdialog ();

if (dr = = DialogResult.OK)//If the user clicks on the OK button, then perform print {Printdocument1.print ();}

The return value of the OK dialog box is ok (usually sent from a button labeled OK).  

dialog box controls:

ColorDialog: Color selection dialog box

FolderBrowserDialog: File path selection dialog box

FontDialog: Font selection dialog box

                                    ↓ Format ↓

OpenFileDialog: Open File dialog box openfiledialog1.filter = "text file. txt|*.txt| video file |*.avi| all Files |*.*";

SaveFileDialog: Save File dialog box problem: If I have saved it, then you do not need to pop up the dialog box in the second save, but do save directly.

absolute path : G:\0720\ with drive letter ...

relative path: According to the directory of your current program, find a folder/css/css1.css

Stream: IO

   StreamReader-Read Flow Sr. ReadToEnd ();

StreamWriter-Output stream SW. Write (the content to be exported);

c#_ layouts, container controls, Print controls, dialog box controls

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.