ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
  • Special cases
  • Limitations
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 FocusOnClick property is used to:
  • Determine if a control gains focus when clicked.
  • Allow or prevent a control from gaining focus when clicked.
Remarks:
  • Controls without "focus on click" do not keep the focus. After a click, the focus is given back to the control that was previously used. The exit code of these controls is not run.
  • By default, all the controls have the "focus on click" except for the Interruption buttons.
  • Android This property is available for the Button controls only.
Example
WINDEV
// Determine whether the Check Box control gains focus when clicked
IF CBOX_Settings.FocusOnClick = True THEN
Info("After a click, the check box keeps focus.")
ELSE
Info("After a click, the check box gives focus back to the previous control.")
END
WINDEV
// Removes the focus when "CBOX_Settings" is clicked if this control keeps focus
IF CBOX_Settings.FocusOnClick = True THEN
CBOX_Settings.FocusOnClick = False
END
Syntax

Determining if a control gains focus when clicked Hide the details

<Result> = <Control used>.FocusOnClick
<Result>: Boolean
  • True if the element gains focus when clicked,
  • False otherwise.
<Control used>: Control name
Name of the control used.

Modifying how a control gains focus Hide the details

<Control used>.FocusOnClick = <With focus/Without focus>
<Control used>: Control name
Name of the control used.
<With focus/Without focus>: Boolean
  • True if the control must gain focus when clicked,
  • False if the previous control must keep the focus.
Remarks

Special cases

  • Regardless of the value of the FocusOnClick property, the focus can be set to the control using one of the following functions:
  • If the control is accessible via the Tab key, it can gain focus during navigation, regardless of the value of the FocusOnClick property.

Limitations

WINDEVUser code (UMC) The FocusOnClick property can only be used in the following controls:
  • Buttons.
  • Check boxes.
  • List boxes.
  • Images.
  • Tabs.
  • Tables.
  • Treeview tables.
Android The FocusOnClick property applies only to Button controls.
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/15/2023

Send a report | Local help