ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Button control
  • Overview
  • Button and tab
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The different types of buttons in a window
Overview
WINDEV and WINDEV Mobile include 5 types of buttons. Each one performs a specific action.
TypeDescription
NormalStandard button.
Sequence of events WLanguage: When the mouse is clicked on a "Normal" button (or when the associated keyboard shortcuts are used):
  • the exit code of the current control is executed.
  • the click code of the Button control is executed.
Usage mode: Button fields of type "Normal" should not be used in windows containing fields. This type of button can be used in toolbars, icon bars or windows without edit controls.
Validate"Default" button of window.
Sequence of WLanguage events When the mouse is clicked on a "Validation" button (or when the associated hotkey is used):
  • the exit code of the current control is executed.
  • the click code of the Button control is executed.
The click code of this button is executed when the Enter key is pressed, if:
  • no other window control intercepts the Enter key.
  • no other window control has focus.
If two validation buttons are found in the same window, the code run is the code of first "validation" button found according to the tab order of window.
How to use A VALIDATION button must be used to validate a window entry. A VALIDATION button must be found in the window as soon as an input can be performed in an edit control. This is the type used for the "OK" buttons.
InterruptButton used to interrupt the current process.
Sequence of events WLanguage: When clicking on an "Interrupt" button (or when using the associated hotkey):
  • the click code of the Button control is executed.
  • the button does not keep focus. The focus is given back to the control used previously.
Note: The current field's output code is not executed when the button is clicked.
How it's used An "Interrupt" button is used, for example, to call up a window (to interrupt the current entry without validating) and then return to continue the entry. This is the type used for the "Help" buttons.
CancelThe button and the Esc key have the same action.
Sequence of events WLanguage: The output code of the current field is not executed when the button is clicked.. The code of this button is run:
  • when pressing the Esc key providing that no other window control intercepts the Esc key.
  • when pressing Alt + F4.
  • when closing the window via the cross.
If two cancellation buttons are found in the same window, the code run is the code of first cancellation button found according to the tab order of window.
Mode of use An "Abort" button field is used to "exit" the Edit control window without performing any validation. In an Edit control window, a "Cancel" button field is required to cancel the current entry without validating it. This is the type used for the "Cancel" buttons.
HelpThe Button control has the same action as the F1 key.. The "Click" event of the control is executed (as opposed to WINDEV 5.5).. This type of Button control opens the help window associated with the current control. A Help Button control loses focus. The focus is given back to the control used previously. Neither the "Leave" nor the "Enter" event of the control is executed when the Help Button control is clicked.


Summary table:
If your window contains no edit control
Type of button to be usedNormal buttons.
If your window contains at least one edit control
Type of button to be used
  • A Validate button.
  • A Cancel button.
  • A Help button (if the controls have associated help windows).
  • All the other buttons are Interruption buttons.
Button and tab
According to the Windows standards, the tabulation key (Tab key) is used to move from a control to another one (in edit mode).
You also have the ability to move from a control (in edit) to another one with the Enter key: to do so, no active button in the window must be a validation button or no other control must be associated with the Enter key.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/19/2025

Send a report | Local help