AMT Help Files

Button Group

Description:

This is an object that can contain one or more buttons, which users can press to interact with the form.

A button group with a single button A button group with multiple buttons

Each button within the button group can have a different label or image and a different value to send, depending on the property settings for Items and values. All other properties are the same for all buttons in the group.

When setting properties for individual buttons within a button group, the property must be followed by an index number in brackets, for example buttongroup.enabled[3] := false, to disable the third button in the group.

Buttons can display different images for each button state, as defined in the ItemsValuesImages property.

When a button is in a state for which no image is defined, the Up state image for that button is displayed if one is defined.

Multiple button groups

Only one button group can send its value at a time. The values of other button groups on the same form are cleared on transmit.
The button group containing the clicked button sends its value regardless of the values assigned to other button groups through code.
If no button is clicked, the value sent depends on the default value situation described below.

Default value

  1. When you have one button group with a default value, the button focus is set to the selected default button and the value of that default button is sent.
  2. When you have multiple button groups on a form, but only one button group has a default value, the value of that default button is sent and that button has focus.
  3. When you have multiple button groups on a form and multiple defaults, the button group created last with a default value receives focus and the value of that default button is sent.
  4. When you have one or more button groups on the form and none have a default value, all button groups are empty and no button has focus.

When you assign a value to any of the button groups or buttons in the form, the default value is replaced by the assigned value.
When you click any button group or button on a form, this is treated as assigning a value and the default value is replaced by the clicked value.

When you clear all button groups on the form, the default value becomes valid again according to the four rules above.

Using a button group with a default value in combination with an OnClick event can cause the OnClick event to fire inconsistently when the screen is transmitted.

Toolbar button icon:

Properties:

Events:

Dynamic code properties:

Contents