Loads text in a certain format. The complete contents of a Text Control are replaced.

Load()

public DialogResult Load();

Load(StreamType)

public DialogResult Load(StreamType streamType);

Load(StreamType, LoadSettings)

public DialogResult Load(StreamType streamType, LoadSettings loadSettings);

Load(String, StreamType)

public void Load(string path, StreamType streamType);

Load(System.IO.FileStream, StreamType)

public void Load(System.IO.FileStream fileStream, StreamType streamType);

Load(Byte[], BinaryStreamType)

public void Load(byte[] binaryData, BinaryStreamType binaryStreamType);

Load(String, StringStreamType)

public void Load(string stringData, StringStreamType stringStreamType);

Load(String, StreamType, LoadSettings)

public void Load(string path, StreamType streamType, LoadSettings loadSettings);

Load(System.IO.FileStream, StreamType, LoadSettings)

public void Load(System.IO.FileStream fileStream, StreamType streamType, LoadSettings loadSettings);

Load(Byte[], BinaryStreamType, LoadSettings)

public void Load(byte[] binaryData, BinaryStreamType binaryStreamType, LoadSettings loadSettings);

Load(String, StringStreamType, LoadSettings)

public void Load(string stringData, StringStreamType stringStreamType, LoadSettings loadSettings);

Parameters

Parameter Description
streamType Specifies one of the StreamType values.
path Specifies a file from which the data is loaded.
fileStream Specifies a file from which the data is loaded. The data is loaded from the stream's current position.
binaryData Specifies a byte array from which the data is loaded.
stringData Specifies a string from which the data is loaded.
binaryStreamType Specifies one of the BinaryStreamType values.
stringStreamType Specifies one of the StringStreamType values.
loadSettings Specifies a LoadSettings object with additional information and settings for the load operation.

Return Value

The implementations that open a dialog box return the dialog's result value.

Examples

The following example shows how to open a dialog box to select a file and load the text from that file. If no StreamType is passed over as an argument, every supported file format can be opened.

// load every possible file format
textControl1.Load();

// load a PDF document
textControl1.Load(TXTextControl.StreamType.AdobePDF);

Further Reading

Learn more about the TXTextControl.TextControl.Load Method in the Text Control Blog: