Loads a rich text format (RTF) or standard ASCII text file into the System.Windows.Forms.RichTextBox control.
When loading a file with the RichTextBox.LoadFile(string) method, the contents of the file being loaded replace the entire contents of the System.Windows.Forms.RichTextBox control. This will cause the values of the TextBoxBase.Text and RichTextBox.Rtf properties to change. You can use this method to load a previously created text or RTF document into the control for manipulation. If you want to save the file, you can use the RichTextBox.SaveFile(string) method.
With this version of the RichTextBox.LoadFile(string) method, if the file being loaded is not an RTF document, an exception will occur. To load a different type of file such as an ASCII text file, use the other versions of this method that accept a value from the System.Windows.Forms.RichTextBoxStreamType enumeration as a parameter.