System.Windows.Forms.RichTextBox.SaveFile Method

Saves the contents of a System.Windows.Forms.RichTextBox control to an open data stream.

Syntax

public void SaveFile (System.IO.Stream data, RichTextBoxStreamType fileType)

Parameters

data
The data stream that contains the file to save to.
fileType
One of the System.Windows.Forms.RichTextBoxStreamType values.

Remarks

This version of the RichTextBox.SaveFile(string) method enables you to save the entire contents of the control to the data stream that is already opened. The data stream can then save the information to a file. You can use the RichTextBox.LoadFile(string) method to load the contents of a file into the System.Windows.Forms.RichTextBox.

This version of the RichTextBox.SaveFile(string) method also enables you to specify a data format of the information that will be sent to the System.IO.Stream object.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0