TX Text Control .NET for Windows Forms

Load Method

Method|Introduced in 12.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.Server.dll from the private NuGet feed or Text Control Offline Packages

Description

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

Syntax

Load(string, StreamType)

Loads text formatted with the specified format. The new text is read from the specified file.

public void Load(string path, StreamType streamType);
ParameterDescription
path

Specifies a file from which the data is loaded.

streamType

Specifies one of the StreamType values.

Load(FileStream, StreamType)

Loads text formatted with the specified format. The new text is read from the specified file stream.

public void Load(FileStream fileStream, StreamType streamType);
ParameterDescription
fileStream

Specifies a file from which the data is loaded. The data is loaded from the stream's current position.

streamType

Specifies one of the StreamType values.

Load(byte[], BinaryStreamType)

Loads text formatted with the specified format. The new text is read from the specified byte array.

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

Specifies a byte array from which the data is loaded.

binaryStreamType

Specifies one of the BinaryStreamType values.

Load(string, StringStreamType)

Loads text formatted with the specified format. The new text is read from the specified string.

public void Load(string stringData, StringStreamType stringStreamType);
ParameterDescription
stringData

Specifies a string from which the data is loaded.

stringStreamType

Specifies one of the StringStreamType values.

Load(string, StreamType, LoadSettings)

Loads text formatted with the specified format. The new text is read from the specified file and loaded using the given special settings.

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

Specifies a file from which the data is loaded.

streamType

Specifies one of the StreamType values.

loadSettings

Specifies a LoadSettings object with additional information and settings for the load operation.

Load(FileStream, StreamType, LoadSettings)

Loads text formatted with the specified format. The new text is read from the specified file stream and loaded using the given special settings.

public void Load(FileStream fileStream, StreamType streamType, LoadSettings loadSettings);
ParameterDescription
fileStream

Specifies a file from which the data is loaded. The data is loaded from the stream's current position.

streamType

Specifies one of the StreamType values.

loadSettings

Specifies a LoadSettings object with additional information and settings for the load operation.

Load(byte[], BinaryStreamType, LoadSettings)

Loads text formatted with the specified format. The new text is read from the specified byte array and loaded using the given special settings.

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

Specifies a byte array from which the data is loaded.

binaryStreamType

Specifies one of the BinaryStreamType values.

loadSettings

Specifies a LoadSettings object with additional information and settings for the load operation.

Load(string, StringStreamType, LoadSettings)

Loads text formatted with the specified format. The new text is read from the specified string and loaded using the given special settings.

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

Specifies a string from which the data is loaded.

stringStreamType

Specifies one of the StringStreamType values.

loadSettings

Specifies a LoadSettings object with additional information and settings for the load operation.

Load(string, StreamType, ref LoadSettings, out byte[])

public void Load(string path, StreamType streamType, ref LoadSettings loadSettings, out byte[] internalFormat);

Examples

The following example loads a small RTF document directly from an in-memory string.

string rtf = @"{\rtf1\ansi\b Quarterly results\b0\par Revenue increased by 12%.}";
textControl.Load(rtf, StringStreamType.RichTextFormat);

Further Reading

  • Improved Documentation Tools for the Text Control MCP Server –