dialog box controls
Set the click button to pop up the dialog box control
1. ColorDialog-Color dialog box
Receive the information that determines the return
========================================================
2. FontDialog-Font dialog box
Receive determines the value returned
FontDialog has a Showcolor property, default is False, click to True, you can choose the font color
Receive Font Color
(Lee Brainstorming Lxc)
===========================================================
3. FolderBrowserDialog-Provide user select folder
The smallest option is still the folder, which returns the path to the selected folder
==============================================
4. Openfaildialog-Open dialog box
Show returns the file path
How do I actually open the selected text? -- Stream IO-pipeline file with binary walk (Li brainstorming lxc)
Refer to namespace IO First, using read stream StreamReader
Create read stream parameter one is the path, parameter two is the encoding method (Li brainstorming lxc)
Read the data under the path, read from the beginning to the end, and receive by RichTextBox (Lee brainstorming Lxc)
===========================================
5. SaveFileDialog-Save dialog box
The value returned by show is the file path
How do I actually save the text? --Stream IO-pipeline file with binary walk (Li brainstorming lxc)
Reference the namespace IO first, using the output stream Streamwriet
Create output stream parameter is path
Output content, and execution (Li brainstorming lxc)
=======================================================
Open and save there is a small loophole, if only the text document, then open and save only the. txt type, how to set?
Open the Settings type openfiledialog.filter= "text file |*.txt"; (Lee brainstorming Lxc)
Save settings Type savefiledialog.filter= "text file |*.txt| Word|*.doc ";
Save settings Default file name savafiledialog.filename= "new text document";
c#-winform-dialog Box control