PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Finds and selects the first element corresponding to the sought text in a window or control.
Example
// Whenever EDT_SRCH is modified
// Finds and highlights all occurrences
// Highlights the 1st occurrence in blue and displays it if necessary
IF ControlFindTextFirst(MyWindow..Name, EDT_SRCH, 0, iLightBlue) = 0 THEN
BTN_NEXT..State = Grayed
Info("Text not found")
ELSE
BTN_NEXT..State = Active
END
Syntax
<Result> = ControlFindTextFirst(<Element> , <Sought Text> [, <Search Options> [, <Highlighting of First Element> [, <Highlighting of Elements Found>]]])
<Result>: Integer
  • Number of occurrences found in the control or window.
  • 0 if no element contains the sought text.
<Element>: Character string (with or without quotes)
Name of element where the search will be performed. This element can correspond to:
  • a window name. The search is performed in the caption of controls, the text of buttons, the text of edit controls, the text of table rows, ... The search is performed in all the visible controls that have no invisible parent.
  • a control name. If this element corresponds to a Ribbon control, the search is performed in all ribbon controls.
<Sought Text>: Character string (with quotes)
  • Text that must be found in the specified element.
  • "" (empty string) to cancel the search.
<Search Options>: Optional Integer constant
Indicates the search options:
WholeWordSearch for a whole word (enclosed in punctuation characters or in space characters)
IgnoreCaseSearch while ignoring the case (uppercase/lowercase characters) or the accented characters
0Search while taking the case into account (uppercase/lowercase characters) on a text "contained in".
No option is selected by default: the search is sensitive to the case and it is performed on incomplete words.
<Highlighting of First Element>: Integer or constant (optional)
Color used to highlight the first element found. This color corresponds to:
Note: The color used by default is dark blue.
<Highlighting of Elements Found>: Integer or constant (optional)
Color used to highlight the occurrences found. This color corresponds to:
Note: The color used by default is light yellow.
Remarks
  • A single search can be performed at a given time in a control or in a window.
  • The call to ControlFindTextFirst cancels a possible previous call to ControlFindHighlight.
  • The search is not performed in the following controls:
    • HTML control and edit control in HTML format.
    • ActiveX control.
    • Zone not displayed in the Looper controls, List Box controls, Table controls.
    • List, table or popup displayed by the combo boxes.
Components
WINDEVReports and Queries wd230obj.dll
Minimum required version
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment