ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
  • Definition
  • Limitation: Selected text highlighting
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures

Definition

The mouse cursor allows you to easily determine where an action will be performed. For a control in edit mode, the cursor turns into a blinking vertical line, allowing you to identify the location of the next character.
Selected characters are displayed in inverted colors. The cursor position is set at the beginning of the selected text.
For example:
Image with input cursor placed at the beginning of the area
The input cursor is placed at the beginning of the input area. Its position is 1.
Image with input cursor placed at the end of the area
The input cursor is placed at the end of the input area. Its position is 7 in this example.
Image with input cursor placed at the beginning of the selected area
The input cursor is placed at the beginning of the selection (position 3 in this example). The CursorEnd property gets and sets the end of the selected area.
The CursorEnd property gets and sets the end position of the mouse selection range in the following controls:
  • Edit control.
  • Editable Combo Box.
  • "Edit control" column and "Editable Combo Box" column in a Table control.
  • WINDEV Word Processing control.
  • WINDEV HTML Editor control.
  • WINDEV Code Editor control.
  • New in version 2025
    WEBDEV - Browser code Code Editor control.
Note: To get the text selected in an Edit control, an editable Combo Box or a column in a Table control, you can use the SelectedText property.
New in version 2025
WEBDEV - Browser code This property is now available in browser code for Code Editor controls.
Tip: To select text in an Edit control from a Button control:
  1. The "Automatic erase" option must not be enabled in the Edit control (unless the entire content of the control is to be deleted).
  2. The Button field must be of type "Interruption" and contain, for example, the following code (see example).
Example
// -- BTN_Selection button field click code (Interrupt button)
// Select the entire text
EDT_Edit1.Cursor = 1
EDT_Edit1.CursorEnd = Length(EDT_Edit1) + 1
// Deselect the text
EDT_Edit1.CursorEnd = EDT_Edit1.Cursor
// Place cursor at the end of the text
EDT_Edit1.CursorEnd = Length(EDT_Edit1) + 1
EDT_Edit1.Cursor = EDT_Edit1.CursorEnd
Syntax

Finding out the position of the last selected character Hide the details

<Position> = <Control used>.CursorEnd
<Position>: Integer
Position of last selected character + 1. If no character is selected, the Cursor and CursorEnd properties are equivalent. If the control is not in edit, the position is 0.
<Control used>: Control name
Name of the control in which a selection was performed.

Selecting a set of characters Hide the details

<Control used>.CursorEnd = <Number of selected characters>
<Control used>: Control name
Name of the control in which a selection must be performed:
  • Edit control.
  • Editable Combo Box control.
  • "Edit control" column and "Editable Combo Box" column in a Table control.
  • WINDEV Word Processing control.
  • WINDEV HTML Editor control.
  • WINDEVWEBDEV - Browser code Code Editor control.
<Number of selected characters>: Integer
The selected string is between the cursor position and the value passed to the CursorEnd property.
The smallest possible value is 1 (cursor on the left). The greatest value corresponds to the number of characters found in the control + 1.
Caution: If the content of the CursorEnd property is assigned to the property itself, the text is deselected.
Remarks

Limitation: Selected text highlighting

Selected text can only be highlighted using inverted colors if the control is in input mode. If the control is not in edit mode, the CursorEnd property returns 0.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/11/2024

Send a report | Local help