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

# TTaskDialogProgressBar.SetRange

Applies the values in the Min and Max properties to the progress bar control on a task dialog.

## Declaration

Source position: dialogs.pp line 711

`public procedure TTaskDialogProgressBar.SetRange(`
`AMin: Integer;`
`AMax: Integer`
`);`

## Arguments

`AMin` |  | Lower limit for the value in Position.
`AMax` |  | Upper limit for the value in Position.

## Description

SetRange is a method used to apply the values in the AMin and AMax arguments to the progress bar control on a task dialog. SetRange is called when the value for the Min or Max property has been updated in the class instance. No actions are performed in the method if the argument values are the same as the existing property values in the class instance.

SetRange ensures that values in the AMin and AMax are in the range 0..High( Word) (32767). This is done to ensure that the values are valid for the platforms and APIs where the value is used. If a valid is too small, it is set to 0. If a value is too large, it is set to High(Word). If AMin is larger than AMax, AMin is set to the value in the upper limit.

SetRange also ensures that the value in Position is within the range specified by Min..Max.

SetRange updates the task dialog where the progress bar is displayed when the Flags property in the dialog includes the value tfShowProgressBar and the Handle for the dialog has been assigned. A TDM_SET_PROGRESS_BAR_RANGE message is sent using the Handle for the dialog and the newly assigned values for Min and Max.

Use the Min and Max properties to set the lower and upper limits for the value in Position.

Set the value in Position to cause the completion percentage to be recalculated and the progress bar control to be redrawn.

## Version info

Added in LCL version 4.0.

## See also

TTaskDialogProgressBar.Min |  | Lower limit for the Position on the progress bar.
TTaskDialogProgressBar.Max |  | Upper limit for the Position on the progress bar.
TTaskDialog.ProgressBar |  | Contains information used to configure and update a progress bar enabled on the task dialog.
TCustomTaskDialog.Handle |  | Handle for the form displayed for the task dialog.
TTaskDialog.Flags |  | Set of options enabled for the Task dialog.
TTaskDialogFlags |  | Set type used to store values from the TTaskDialogFlag enumeration.
TTaskDialogFlag |  | Represents options that can be enabled for TTaskDialog.