BaseGallery.CustomDraw Event
Allows you to draw the gallery manually.
Namespace: DevExpress.XtraBars.Ribbon.Gallery
Assembly: DevExpress.XtraBars.v24.2.dll
Declaration
[DXCategory("Events")]
public event EventHandler<ImageGalleryCustomDrawEventArgs> CustomDraw
Event Data
The CustomDraw event's data class is ImageGalleryCustomDrawEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Appearance | Gets the gallery’s appearance settings. |
Bounds | Gets the bounding rectangle of the displayed ribbon gallery. |
Gallery | Gets the current gallery. |
Info | Gets information about the displayed gallery. |
Painter | Gets an object that performs paint operations. |
The event data class exposes the following methods:
Method | Description |
---|---|
DefaultDrawBackground() | Uses default drawing logic to draw the gallery’s background. |
DefaultDrawGroups() | Uses default drawing logic to draw the gallery’s groups. |
DefaultDrawMarqueeSelection() | Uses default drawing logic to draw the gallery’s marquee selection. |
Remarks
The following code sample displays the gallery control with a custom background:
private void galleryControl1_Gallery_CustomDraw(object sender, DevExpress.XtraBars.Ribbon.ImageGalleryCustomDrawEventArgs e) {
e.Cache.FillRectangle(Color.Red, e.Bounds);
e.DefaultDrawGroups();
e.DefaultDrawMarqueeSelection();
e.Handled = true;
}
See Also