The Selection class describes and handles the attributes of a text selection. Each of the properties of this class returns the property's default value if the selection does not contain a common value. In this case the Is
public class Selection
Public Class Selection
The following example shows how to select and format a piece of text.
textControl1.Text = "TX Text Control";
TXTextControl.Selection mySel = new TXTextControl.Selection(3, 4);
mySel.Bold = true;
mySel.Italic = true;
textControl1.Selection = mySel;
TextControl1.Text = "TX Text Control"
Dim mySel as TXTextControl.Selection = New TXTextControl.Selection(3, 4)
mySel.Bold = True
mySel.Italic = True
TextControl1.Selection = mySel
Constructor | Description |
---|---|
Selection | Creates a new instance of the Selection class. |
Enumeration | Description |
---|---|
Attribute | Determines a certain attribute. |
Dialog |
Specifies identifiers to indicate the return value of a dialog box. |
Method | Description |
---|---|
Change |
Changes the capitalization of all selected characters depending on the settings parameter. |
Change |
Changes the writing direction of all selected paragraphs. |
Decrease |
Decreases the left indent of all paragraphs contained in the current text selection. |
Grow |
Increases the font size of each font contained in the current text selection. |
Increase |
Increases the left indent of all paragraphs contained in the current text selection. |
Is |
Informs about whether a certain attribute has the same value for the complete selection. |
Load | Exchanges the currently selected text with text in a certain format. |
Remove |
Resets all character based formatting attributes of the selected text to its default values. |
Remove |
Removes all character based styles of the selected text so that all attributes are reset to the attributes of the paragraph style. |
Save | Saves the selected text of a document with the specified format. |
Shrink |
Decreases the font size of each font contained in the current text selection. |
Property | Description |
---|---|
Auto |
Gets or sets values specifying wheather the selected text is automatically sub- or superscripted. |
Baseline | Gets or sets the baseline alignment, in twips, of the selected text. |
Bold | Gets or sets the bold attribute of the selected text. |
Capitals | Gets or sets values specifying wheather the lowercase letters of the selected text are displayed with capital letters. |
Character |
Gets or sets a character scaling, in percent of the average character width, of the selected text. |
Character |
Gets or sets a character spacing value, in twips, of the selected text. |
Culture | Gets or sets the culture of the selected text. |
Font |
Gets or sets the font of the selected text. |
Font |
Gets or sets the font's size, in twips, of the selected text. |
Fore |
Returns or sets the color used to display the selected text. |
Formatting |
Gets or sets the formatting style of the selected text. |
Italic | Gets or sets the italic attribute of the selected text. |
Length | Returns or sets the number of characters selected. |
List |
Gets or sets a bulleted or numbered list and/or its formatting attributes for the selected text. |
Paragraph |
Gets or sets the formatting attributes of the selected paragraphs. |
Section |
Gets or sets page settings such as margins, size and orientation for the selected text. |
Start | Gets or sets the starting point of selected text. |
Strikeout | Gets or sets the strikeout attribute of the selected text. |
Text | Gets or sets a string containing the currently selected text. |
Text |
Gets or sets the background color for selected text. |
Underline | Gets or sets underlining styles for the selected text. |
Learn more about the TXText