windowsforms-devexpress-dot-xtrabars-dot-ribbon-dot-gallery-dot-basegallery-bd7ec1c4.md
Allows you to draw the gallery manually.
Namespace : DevExpress.XtraBars.Ribbon.Gallery
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DXCategory("Events")]
public event EventHandler<ImageGalleryCustomDrawEventArgs> CustomDraw
<DXCategory("Events")>
Public Event CustomDraw As EventHandler(Of ImageGalleryCustomDrawEventArgs)
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. |
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;
}
Private Sub galleryControl1_Gallery_CustomDraw(ByVal sender As Object, ByVal e As DevExpress.XtraBars.Ribbon.ImageGalleryCustomDrawEventArgs)
e.Cache.FillRectangle(Color.Red, e.Bounds)
e.DefaultDrawGroups()
e.DefaultDrawMarqueeSelection()
e.Handled = True
End Sub
See Also