Skip to main content

ToolboxControl.CustomDrawElement Event

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

Namespace: DevExpress.XtraToolbox

Assembly: DevExpress.XtraBars.v23.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