All docs
V20.1
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

AccordionControl.CustomDrawHamburgerButton Event

Fires before the hamburger button is displayed. Provides access to a drawing surface and allows you to draw the hamburger button.

Namespace: DevExpress.XtraBars.Navigation

Assembly: DevExpress.XtraBars.v20.1.dll

Declaration

[DXCategory("Events")]
public event CustomDrawHamburgerButtonEventHandler CustomDrawHamburgerButton
<DXCategory("Events")>
Public Event CustomDrawHamburgerButton As CustomDrawHamburgerButtonEventHandler

Event Data

The CustomDrawHamburgerButton event's data class is CustomDrawHamburgerButtonEventArgs. The following properties provide information specific to this event:

Property Description
Bounds Gets the hamburger button bounds.
Cache Provides access to a drawing surface and a pen/brush/font cache.
Handled Gets or sets whether the event is handled.
State Gets the hamburger button state: normal, hot tracked, pressed, disabled, or selected.

Examples

The code below shows how to draw a custom image in the hamburger button.

private void accordionControl_CustomDrawHamburgerButton(object sender, CustomDrawHamburgerButtonEventArgs e) {
    // The State event argument returns whether the hamburger button is
    // enabled, disabled, hot tracked, etc.
    if (e.State == DevExpress.Utils.Drawing.ObjectState.Normal) {
        SvgImage image = svgImageCollection1[1];
        var palette = SvgPaletteHelper.GetSvgPalette(this.LookAndFeel, ObjectState.Normal);
        e.Cache.DrawImage(image.Render(e.Bounds.Size, palette), e.Bounds.Location);
        // The Handled event argument should be set to true
        // to prevent the default draw algorithm from being invoked.
        e.Handled = true;
    }
}
See Also