Skip to main content

TcxCustomTrackBarProperties.OnGetThumbRect Event

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

Declaration

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