RichTextBox Class
Allows the user to display a rich-text string within a control in a form that can be edited by the user.
Namespace: elsystem.windows.forms
Properties
Additional properties, methods, and events are inherited. Inherited properties, methods, and events are described in the Help topics for the classes listed under Inheritance Hierarchy (see below).
Name | Type | Description | |
BorderStyle | enum | Gets or sets a value indicating the border style of the control. | |
Multiline | bool | Gets or sets a value indicating that the RichTextBox is a multiline RichTextBox. This property is true if the RichTextBox is a multiline RichTextBox. This property is false if the RichTextBox is not a multiline RichTextBox. | |
Rtf | string | Gets or sets the RichTextBox's contents. This string property may include rich text format (RTF) codes. | |
SelectedText |
string | Gets or sets the selected text. | |
SelectionAlignment |
enum | Gets or sets the alignment of the current selection or the alignment to apply at the insertion point. See HorizontalAlignment for a list of options. | |
SelectionBackColor |
Object | Gets or sets the background color of the selected text. See Color. | |
SelectionBullet | bool | Gets or sets a Boolean value that indicates whether the bullet style is applied to the selected text. | |
SelectionColor | Object | Gets or sets the color of the selected text or the color to be applied at the insertion point. See Color. | |
SelectionFont | Object | Gets or sets the font applied to the selected text. See Font. | |
SelectionIndent | int | Gets or sets the length of the left indentation, in pixels, of the line on which the selected text appears. | |
SelectionRightIndent |
int | Gets or sets the length of the indentation from the right edge of the RichTextBox of the line on which the selected text appears. This value is in pixels. |
Methods
Name | Description | |
Clear() | Clears all text from the RichTextBox. | |
Create() | Initializes a new instance of the control with default settings. | |
Create(text,width,height) | Initializes a new instance of the control. Parameters include the text to be displayed followed by the width and height of the control. | |
LoadFile(path) | Loads a rich text format (RTF) or standard ASCII text file into the RichTextBox control. The path parameter is a string containing the path to the file to be loaded. | |
LoadFile(path, FileType) | Loads a specific type of file into the RichTextBox control. The path parameter is a string containing the path to the file to be loaded. FileType is the RichTextBoxStreamType of the file to be loaded. | |
RemoveGradient() | Removes the gradient from the rich text box. | |
SaveFile(path) | Saves the contents of the RichTextBox control. The path parameter is a string containing the path to the file to be saved. | |
SaveFile(path, FileType) | Saves the contents of the RichTextBox control. The path parameter is a string containing the path to the file to be saved. FileType is the RichTextBoxStreamType of the file to be saved. | |
Select(start,length) | Gets a sub-string from the text box string based on the position of the start character and length of characters to select. | |
SetLinearGradient(mode,startColor,EndColor) |
Sets the linear gradient of a text box. Parameters include the mode (see LinearGradientMode) followed by the startColor and endColor of the gradient. |
|
SetRadialGradient(startColor,EndColor) | Initializes a new instance of the control using the the startColor and endColor of the gradient. |
Events
Name | Description | |
HyperLinkClicked |
Occurs when a link in the text inside the rich text box is clicked. See HyperLinkClickedEventArgs for a list of the properties supplied by the to the event handler. |
|
KeyDown |
Occurs when a key is pressed down while the control has focus. See KeyEventArgs for a list of the properties supplied to the event handler. |
|
KeyPress |
Occurs when a key is pressed while the control has focus. See KeyPressEventArgs for a list of the properties supplied to the event handler. |
|
KeyUp |
Occurs when a key is released while the control has focus. See KeyEventArgs for a list of the properties supplied to the event handler. |
Inheritance Hierarchy
elsystem.windows.forms.ELWFComponent
elsystem.windows.forms.Control
elsystem.windows.forms.RichTextBox