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

ToolboxControl.CustomDrawElement Event

Provides the ability to perform custom painting of the ToolboxControl visual elements.

Namespace: DevExpress.XtraToolbox

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DXCategory("Events")]
public event ToolboxCustomDrawElementEventHandler CustomDrawElement

#Event Data

The CustomDrawElement event's data class is DevExpress.XtraToolbox.ToolboxCustomDrawElementEventArgs.

#Remarks

The CustomDrawElement event fires when a particular ToolboxControl visual element is about to be painted, and allows you to perform custom painting of that element. Using the CustomDrawElement event, you can custom paint groups, items, the Menu, Expand, More items, and scroll buttons. To retrieve the information about the visual element being painted, use the ToolboxCustomDrawElementEventArgs.ElementInfo property.

To perform the default painting of the element background, image or caption, call the arguments’ DrawBackground, DrawImage or DrawCaption method, respectively.

If you custom paint a visual element using the CustomDrawElement event, set the ToolboxCustomDrawElementEventArgs.Handled parameter to true to prevent the default painting mechanism from being invoked after your CustomDrawElement event handler is completed. Otherwise, your painting will be overridden by the default painting mechanism.

See Also