ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
  • Definition
  • Special case: RTF control
  • Limitation: Changing the position of the input cursor
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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.

If a selection is made, selected characters are highlighted. The cursor position is set at the beginning of the highlighted section.
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 area in inverted colors
The input cursor is placed at the beginning of the highlighted section (position 3 in this example). The CursorEnd property gets and sets the end of the selected area.
The Cursor property gets and sets the position of the mouse cursor in one of the following controls:
  • 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.
  • WINDEV Code Editor control.
  • New in version SaaS
    WEBDEV - Browser code Code Editor control.
Remark: To get the text selected in an Edit control, an editable Combo Box or a column in a Table control, you can use SelectedText.
New in version SaaS
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 must be an "Interrupt" button and contain the following code, for example:
    // -- Click of BTN_Selection (Interrupt button)
    // Select the entire text
    EDT_Edit1.Cursor = 1
    EDT_Edit1.CursorEnd = Length(EDT_Edit1) + 1
    ScreenFirst(EDT_Edit1)
Example
// Insert a character string at cursor position
EDT_ControlName = Left(EDT_ControlName, EDT_ControlName.Cursor) + ...
		" is called " + Right(EDT_ControlName, EDT_ControlName.Cursor)
Syntax

Getting the position of the input cursor Hide the details

<Current value> = <Control used>.Cursor
<Current value>: Integer
Current position of the input cursor in the control. This position can vary between:
  • 0 (the control is not in edit mode and there is no input cursor).
  • The number of characters displayed in the control + 1 (the input cursor is located at the end of the input area).
<Control used>: Control name
Name of the control in which the input cursor is displayed:
  • 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.

Changing the position of the input cursor Hide the details

<Control used>.Cursor = <New value>
<Control used>: Control name
Name of the control in which the position of the input cursor is to be changed:
  • 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.
<New value>: Integer
New position of the input cursor, between 1 and the number of characters currently displayed in the control + 1.
Remarks
WINDEVWindowsUser code (UMC)

Special case: RTF control

The number of characters in an RTF control may be different if it contains Carriage Returns (CR).
In a non-RTF control, a carriage return corresponds to two characters, while in an RTF control, it corresponds to one character.

Limitation: Changing the position of the input cursor

The position of the input cursor can be changed only if the control is in edit mode. If the control is not in edit mode, the Cursor property returns 0.
Reminder: To set focus on a control, use ScreenFirst or SetFocusAndReturnToUserInput.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/27/2024

Send a report | Local help