Container printing, container
Layout:
There are two attributes:
Anchor: Lock position
Dock: fill position
Generally, the Dock is used with container controls.
Container Control:
Panel: it is an area similar to a DIV. It can be independently laid out, and other controls and containers can be laid out again inside it.
FlowLayoutPanel: a streaming layout container. The content is arranged from left to right by default. If the width is insufficient, the new line is automatically wrapped.
GroupBox: it is still a container and has all Panel attributes. It has more titles and border styles than Panel.
TabControl: tab container
SplitContainer: Binary container
TableLayoutPanel: Table container
Certificate ------------------------------------------------------------------------------------------------------------------------------------------
Print control:
PrintDocument: Specifies the object to be printed. It must be added to the PrinterDocument class during printing. The printed content can be set through its PrinterPage event.
(The program does not know what you want to print. It will only look for the object to be printed. What you want to do is to draw the content to be printed to the printed object)
PageSetupDialog: the print Setting Dialog Box. Common page setting elements include paper, direction, and margin.
PrintPreviewControl: print preview control,
To display the print effect of a document. This control contains
Click to zoom in or display one or more pages. The key property Document of the control is the same as that of the PrinterDialog control.Previewed document, which must be a PrinterDocument object.
PrintPreviewDialog: print preview dialog box
DialogResult dr = printDialog1.ShowDialog ();
If (dr = DialogResult. OK) // if the user clicks the OK button, print it
{
PrintDocument1.Print ();
}
DialogResult is an enumeration class that can be instantiated to receive user operations in the dialog box.
Dialog Box control:
ColorDialog-color selection dialog box
DialogResult dr = colorDialog1.ShowDialog ();
If (dr = DialogResult. OK)
{
TextBox1.ForeColor = colorDialog1.Color;
}
FolderBrowserDialog-file path selection dialog box
Actually only
FontDialog-font selection dialog box properties -- showcolor select color options
FontDialog1.ShowDialog ();
TextBox2.Font = fontDialog1.Font; // change the font.
TextBox2.ForeColor = fontDialog1.Color; // change the font color.
OpenFileDialog-Open File Dialog Box
OpenFileDialog1.Filter = "audio file .txt | *. txt | video file | *. avi | all files | *.*";
SaveFileDialog-save file dialog box
If (path = "")
{
SaveFileDialog1.FileName = "New Startup File .txt ";
DialogResult dr = saveFileDialog1.ShowDialog ();
If (dr = DialogResult. OK)
{
ToolStripStatusLabel1.Text = saveFileDialog1.FileName;
StreamWriter sw = new StreamWriter (saveFileDialog1.FileName );
Sw. Write (textBox1.Text );
Sw. Close ();
Path = saveFileDialog1.FileName;
}
}
Else
{
StreamWriter sw = new StreamWriter (path );
Sw. Write (textBox1.Text );
Sw. Close ();
}
Save:
SaveFileDialog1.FileName = "New Startup File .txt ";
DialogResult dr = saveFileDialog1.ShowDialog ();
If (dr = DialogResult. OK)
{
ToolStripStatusLabel1.Text = saveFileDialog1.FileName;
StreamWriter sw = new StreamWriter (saveFileDialog1.FileName );
Sw. Write (textBox1.Text );
Sw. Close ();
}
Absolute path: G: \ 0720 \...
Relative Path: Find a folder/css/css1.css according to the directory of your current program
☆Stream: IO
StreamReader-read stream sr. ReadToEnd ();
StreamWriter-output stream sw. Write (content to be output );