[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'InterfaceBase' (#lcl)

# TDialogButtons.FindButton

Finds the button associated with (one of) the given modal result values.

## Declaration

Source position: interfacebase.pp line 112

`public function TDialogButtons.FindButton(`
`AModalResult: LongInt`
`):TDialogButton; function TDialogButtons.FindButton(`
`Order: array of LongInt`
`):TDialogButton;`

## Arguments

`AModalResult` |  | The modal result value for the button located in the method.

## Function result

Dialog button which uses the modal result value.

## Arguments

`Order` |  | List of modal result values to find in the collection.

## Description

FindButton is an overloaded TDialogButton function used to locate a dialog button in the collection which uses the specified modal result value. Overloaded variants are provided which accept one or multiple modal result values to locate in the method.

AModalResult contains the modal result value to locate in the collection Items.

AOrder allows an array of modal result values to be located in the method. It specifies the search order for the modal result values.

FindButton iterates over the Items in the collection to find the first button which uses the modal result value(s). The return value is the first TDialogButton instance in Items which matches the requested value(s).

## See also

TDialogButtons.Items |  | Provides indexed access to the dialog buttons in the collection.
TDialogButton.ModalResult |  | The modal result value returned when the button is clicked.