ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / How to proceed? / Windows, pages and controls
  • Method 1: Using WLanguage events associated with the field
  • Method 2: Using the Event function
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The keyboard cursor ("carret") is not always easy to locate in a window: it's not always clear which field you're typing in.
How to highlight the control where the input is performed?
Two methods are available:
Method 1: Using WLanguage events associated with the field
  • In the entry code of control, change the background color and/or the color of characters with BackgroundColor and Color.
  • In the exit code of the control, use the default style color for the background color and/or color of characters with BackgroundColor and Color with the DefaultColor constant.
Example:
// -- Entrée dans le champ
MySelf.CouleurFond = DarkBlue
MySelf.Couleur = White
// Perte de focus
MySelf.CouleurFond = DefaultColor
MySelf.Couleur = DefaultColor
Disadvantage: This operation must be performed "manually" on each field.. This method is convenient if a small number of controls must be modified.
Method 2: Using the Event function
Event is used to intercept the Taking Focus and Losing Focus events in the project or in each window to process.
Each one of the events must be associated with a WLanguage procedure in order to change the color or to restore the initial color.
Example:
  • Code to enter in the "Initialization" event of the project:
    Event(ProcColorie, "*.*", 7) // 7 = WM_SETFOCUS
    Event(ProcDeColorie, "*.*", 8) // 8 = WM_KILLFOCUS
  • Global WLanguage procedure called by the Event function (gain of focus):
    PROCEDURE ProcColorie
    {_EVE.name, indControl}..BackgroundColor = DarkBlue
    {_EVE.name, indControl}..Color = White
  • Global WLanguage procedure called by the Event function (loss of focus):
    PROCEDURE ProcDeColorie
    {_EVE.name, indControl}..BackgroundColor = DefaultColor
    {_EVE.name, indControl}..Color = DefaultColor
Minimum version required
  • Version 14
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help