- Managing the states via the style
- Configuring one of the states of the Button control
- Managing the states via images
The different states of a Button control in a window
In WINDEV or WINDEV Mobile applications, Button controls can have multiple states. These states allow you to manage the different actions performed by the user on the Button control.
The state of the Button control state can be set:
- by an image.
- by the style of the control.
The different states are as follows:
|Normal||The Button control is idle.|
|Pressed||The user has clicked the Button control, but has not yet released the mouse button. The Button control is pressed.|
|Grayed out||The Button control is disabled (grayed out) and cannot be selected by the user.|
|Focused||The Button control has focus, it is selected by the user.|
|Hover||The Button control is hovered over by the mouse cursor.|
Managing the states via the style
The "Style" tab allows you to easily manage the different states of a Button control that displays text. Simply select the desired state and the element to be configured.
The "General" state corresponds to the general style of the Button Control. This general style is applied to all the states of the control ("Normal", "Hover" and "Pressed").
Configuring one of the states of the Button control
To configure one of the states of the Button control:
- Display the "Style" tab of the control description.
- Select the desired state.
- Select the element to be defined according to the state
- Define the characteristics of the element for the selected state (background color, borders, etc.).
Remark: In this case, the "Grayed" state corresponds only to the grayed out text.
Managing the states via images
Use images to handle the different states of a Button control that displays images or that has a redefined shape.
Each state corresponds to a specific drawing. All the drawings are saved in a single image. This image is associated with the Button control: all you have to do is specify the number of states (or drawings) found in the image file.
Example: BlueButton.gif image file
Button control: idle, pressed, grayed out, selected, hovered
WINDEV includes two types of images for Button controls:
- image of the control border: this image is used to define the shape of the Button control. It can contain up to 5 drawings, corresponding to the different states of the control.
Only the image of the Button control border can be configured.
- image associated with the control: this image will be displayed on the Button control, overlaying the border (if any) of the control. It can contain up to 5 drawings, corresponding to the different states of the control.
You have the ability to manage separately:
- the states of the image associated with the Button control
- the states of the image of the Button control border.
The image associated with the Button control can then be reused regardless of the shape of the control.
This page is also available for…