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
Public property BorderStyle enum Gets or sets a value indicating the border style of the control.
Public property 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.
Public property Rtf string Gets or sets the RichTextBox's contents. This string property may include rich text format (RTF) codes.
Methods
  Name Description
Public property Create() Initializes a new instance of the control with default settings.
Public property 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.
Public property 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.
Public property 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.
Public property RemoveGradient() Removes the gradient from the rich text box.
Public property SaveFile(path) Saves the contents of the RichTextBox control. The path parameter is a string containing the path to the file to be saved.
Public property 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.
Public property 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.
Public property 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.

Public property SetRadialGradient(startColor,EndColor) Initializes a new instance of the control using the

the startColor and endColor of the gradient.

Events
  Name Description
Public event

KeyDown

Occurs when a key is pressed down while the control has focus. See KeyEventArgs for the properties returned by the handler's args parameter.

Public event

KeyPress

Occurs when a key is pressed while the control has focus. See KeyPressEventArgs for the properties returned by the handler's args parameter.

Public event

KeyUp

Occurs when a key is released while the control has focus. See KeyEventArgs for the properties returned by the handler's args parameter