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
  • Implementation
  • Create an drop-down Button control
  • Characteristics and operating mode of drop-down buttons
  • Arrow position
  • Drop-down button that opens a popup window
  • Split button that opens a menu and saves the selected option
  • Drop-down button in a Ribbon control
  • Drop-down button appearance
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
The drop-down button is a Button control used to expand:
  • a context menu.
  • a popup window.
WINDEV includes two types of buttons with arrows;
  • the arrow button: in this case, clicking on the button or arrow executes the same code.
  • button with separate arrow: in this case, the button and arrow perform two separate actions.
Implementation

Create an drop-down Button control

To crate a drop-down Button control:
  1. Create a Button control.
  2. Open the "UI" tab in the control description window and select the type of arrow. The available options are as follows:
    • No arrow (default): the Button field is a standard button.
    • Arrow button: button and arrow perform the same action.
      You can choose:
      • run the click code of the Button control.
      • expand the context menu associated with the Button control.
      • open one of the application windows (a popup window with a specific menu, for example).
    • Button with separate arrow: the button field and arrow perform two separate actions.
      • The button runs its code.
      • The arrow runs:
        - the arrow click code.
        - the specified action:
        You can choose:
        • run the click code of the Button control.
        • expand the context menu associated with the Button control.
          In this case, it is possible to check the option "Execute the last selected option in the drop-down menu when the button is pressed".
        • open one of the application windows (a popup window with a specific menu, for example).
  3. Validate the description window.
Characteristics and operating mode of drop-down buttons

Arrow position

Depending on the size and position of the text, or if the button includes an icon, the arrow can be on the right or below the Button control.

Drop-down button that opens a popup window

If the button opens a window, we recommend using a window with the following characteristics:
  • no titles,
  • no menus,
  • reduced size,
  • simple borders.
Note: It is possible to create a popup window directly ("Blank for popup" option in the "Standard" tab of the window creation wizard)..

Split button that opens a menu and saves the selected option

When creating a button with a separate arrow opening a menu, if you have checked the "Execute the last selected option in the drop-down menu when the button is pressed" option, the Button field will function as follows:
  • the first time the window that contains the button is opened, the button shows the first option of the context menu (text and image of the option).
  • when the user expands the context menu and selects an option:
    • the text and image of the option automatically appear in the button.
    • the code of the selected option is executed.
Note: if the menu option contains an image, WINDEV automatically manages the different states on the image displayed in the button..

Drop-down button in a Ribbon control

If there is a Button control in the group of a Ribbon control, the "UI" tab of the Button control allows you to configure how the button will behave when the ribbon is reduced.
You can:
  • avoid reducing the control.
  • reduce it to display the button image and text.
  • reduce it to display the button image.
The last two options are useful for buttons that show a specific icon and label.

Drop-down button appearance

The "Style" tab of the drop-down button description window allows you to define the characteristics of the divider. You can set:
  • the opacity,
  • the type of arrow (triangle or chevron),
  • the divider color.
    The "Transparent" option defines a drop-down button without divider.
These options can be set for a single button state or for all the button states.
Minimum version required
  • Version 17
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help