PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • Selection in a Word Processing control
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
The Selection property is used to get the characteristics of the selection (or cursor):
  • WINDEV in a Word Processing control.
    Remark: This selection is in the section being edited in the control (body, header or footer).
  • Versions 23 and later
    WINDEV in a Spreadsheet control.
    New in version 23
    WINDEV in a Spreadsheet control.
    WINDEV in a Spreadsheet control.
  • Versions 26 and later
    WINDEV in an HTML Editor control
    New in version 26
    WINDEV in an HTML Editor control
    WINDEV in an HTML Editor control
  • Versions 27 and later
    in a Diagram Editor control.
    New in version 27
    in a Diagram Editor control.
    in a Diagram Editor control.
Example
WINDEV
// Get the fragment selected by the user
MySelection is docFragment = WP_Doc.Selection.Fragment
// The user selection is displayed in bold
MySelection.Formatting.FontBold = True
// Get the first text section selected by the user
MySelection1 is docSection = WP_Doc.Selection.Section[1]
Versions 27 and later
// Retrieve the selected elements in a Diagram Editor control
MySelection is diagSélection <- DIAGEDT_MyDiagram.Selection
IF MySelection.Shape.Count > 0 THEN
// Get the shapes
FOR EACH stShape OF MySelection.Shape
STC_SELECTION_INFO = stShape.Name + "has been selected." +
" [ " + stShape.X + ", " + stShape.Y + " - " + stShape.Width +
"x" + stShape.Height + " ]"
END
ELSE
STC_SELECTION_INFO = "Click a shape in the diagram to get the selection"
END
New in version 27
// Retrieve the selected elements in a Diagram Editor control
MySelection is diagSélection <- DIAGEDT_MyDiagram.Selection
IF MySelection.Shape.Count > 0 THEN
// Get the shapes
FOR EACH stShape OF MySelection.Shape
STC_SELECTION_INFO = stShape.Name + "has been selected." +
" [ " + stShape.X + ", " + stShape.Y + " - " + stShape.Width +
"x" + stShape.Height + " ]"
END
ELSE
STC_SELECTION_INFO = "Click a shape in the diagram to get the selection"
END
// Retrieve the selected elements in a Diagram Editor control
MySelection is diagSélection <- DIAGEDT_MyDiagram.Selection
IF MySelection.Shape.Count > 0 THEN
// Get the shapes
FOR EACH stShape OF MySelection.Shape
STC_SELECTION_INFO = stShape.Name + "has been selected." +
" [ " + stShape.X + ", " + stShape.Y + " - " + stShape.Width +
"x" + stShape.Height + " ]"
END
ELSE
STC_SELECTION_INFO = "Click a shape in the diagram to get the selection"
END
Syntax
WINDEV

Retrieving the properties of the selection in a Word Processing control Hide the details

<Result> = <Word Processing control>.Selection.<Property>
<Result>: Type corresponding to the property used
Expected result (see "Remarks").
<Word Processing control>: Control name
Name of Word Processing control.
<Property>:
Property to use on the selection (see Remarks).
Versions 23 and later
WINDEV

Retrieving the properties of the selection in a Spreadsheet control Hide the details

<Result> = <Spreadsheet control>.Selection
<Result>: psheetSelection variable
psheetSelection variable describing the selection.
<Spreadsheet control>: Control name
Name of Spreadsheet control.
New in version 23
WINDEV

Retrieving the properties of the selection in a Spreadsheet control Hide the details

<Result> = <Spreadsheet control>.Selection
<Result>: psheetSelection variable
psheetSelection variable describing the selection.
<Spreadsheet control>: Control name
Name of Spreadsheet control.
WINDEV

Retrieving the properties of the selection in a Spreadsheet control Hide the details

<Result> = <Spreadsheet control>.Selection
<Result>: psheetSelection variable
psheetSelection variable describing the selection.
<Spreadsheet control>: Control name
Name of Spreadsheet control.
Versions 26 and later
WINDEV

Retrieving the properties of the selection in an HTML Editor control Hide the details

<Result> = <HTML Editor control>.Selection
<Result>: edtHTMLSelection variable
edtHTMLSelection variable describing the selection.
<HTML Editor control>: Control name
Name of the HTML Editor control.
New in version 26
WINDEV

Retrieving the properties of the selection in an HTML Editor control Hide the details

<Result> = <HTML Editor control>.Selection
<Result>: edtHTMLSelection variable
edtHTMLSelection variable describing the selection.
<HTML Editor control>: Control name
Name of the HTML Editor control.
WINDEV

Retrieving the properties of the selection in an HTML Editor control Hide the details

<Result> = <HTML Editor control>.Selection
<Result>: edtHTMLSelection variable
edtHTMLSelection variable describing the selection.
<HTML Editor control>: Control name
Name of the HTML Editor control.
Versions 27 and later

Retrieving the properties of the selection in a Diagram Editor control Hide the details

<Result> = <Diagram Editor control>.Selection
<Result>: diagSelection variable
diagSelection variable describing the selection.
<Diagram Editor control>: Control name
Name of the Diagram Editor control.
New in version 27

Retrieving the properties of the selection in a Diagram Editor control Hide the details

<Result> = <Diagram Editor control>.Selection
<Result>: diagSelection variable
diagSelection variable describing the selection.
<Diagram Editor control>: Control name
Name of the Diagram Editor control.

Retrieving the properties of the selection in a Diagram Editor control Hide the details

<Result> = <Diagram Editor control>.Selection
<Result>: diagSelection variable
diagSelection variable describing the selection.
<Diagram Editor control>: Control name
Name of the Diagram Editor control.
Remarks
WINDEV

Selection in a Word Processing control

PropertyExplanations
Fragment<Result> corresponds to a docFragment variable containing the characteristics of selected fragment.
Example: <Result> = <Word Processing control>.Selection.Fragment
Section[X]Used to get the section associated with the selection.
  • X corresponds to the number of section to get.
  • <Result> corresponds to a docSection variable containing the characteristics of the section associated with the selection.
Example: <Result> = <Word Processing control>.Selection.Section[1]
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment