SelectTextLine

Description

Selects the line containing the insertion point in a RichTextEdit control.

Applies to

RichTextEdit and DataWindow controls

Syntax

rtename.SelectTextLine ( )

Argument

Description

rtename

The name of the RichTextEdit or DataWindow control in which you want select a line. The DataWindow object in the DataWindow control must be a RichTextEdit DataWindow.

Returns

Integer. Returns the number of characters selected if it succeeds and -1 if an error occurs.

Usage

If the RichTextEdit control contains a selection, the insertion point is either at the beginning or end of the selection. The way the text was selected determines which. If the user made the selection by dragging toward the end, then calling SelectTextLine selects the line at the end of the selection. If the user dragged back, then SelectTextLine selects the line at the beginning of the selection.

SelectTextLine does not select the line-ending characters (carriage return and linefeed in Windows).

Examples

Example 1

This statement selects the current line:

rte_1.SelectTextLine()

See also