Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomTrackBarProperties.OnGetThumbRect Event

In This Article

Specifies the size of the custom painted track bar’s thumb.

#Declaration

Delphi
property OnGetThumbRect: TcxGetThumbRectEvent read; write;

#Remarks

You may customize the thumb’s appearance. Set the ThumbType property to cxttCustom for this purpose and handle the OnDrawThumb to perform thumb painting. If the OnGetThumbRect event is not handled, the OnDrawThumb event handler will get the default bounding rectangle of the track bar’s thumb as its ARect parameter. This is likely to give undesirable results (the thumb will be painted at a wrong position, stretched, etc.) Thus, you need to handle the OnGetThumbRect event to specify the size of the custom track bar’s thumb.

The Sender parameter of the event can be used to determine the track bar editor whose thumb is being painted.

Specify the size of the thumb by passing an appropriate rectangle as the ARect parameter. The width and height of this rectangle determine the width and height of the custom track bar’s thumb.

Please refer to the OnDrawThumb event description for details on custom track bar’s thumb painting. The description also provides an example of handling both the OnDrawThumb and OnGetThumbRect events.

See Also