Back to Devexpress

BaseGallery.CustomDraw Event

windowsforms-devexpress-dot-xtrabars-dot-ribbon-dot-gallery-dot-basegallery-bd7ec1c4.md

latest3.4 KB
Original Source

BaseGallery.CustomDraw Event

Allows you to draw the gallery manually.

Namespace : DevExpress.XtraBars.Ribbon.Gallery

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event EventHandler<ImageGalleryCustomDrawEventArgs> CustomDraw
vb
<DXCategory("Events")>
Public Event CustomDraw As EventHandler(Of ImageGalleryCustomDrawEventArgs)

Event Data

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

PropertyDescription
AppearanceGets the gallery’s appearance settings.
BoundsGets the bounding rectangle of the displayed ribbon gallery.
GalleryGets the current gallery.
InfoGets information about the displayed gallery.
PainterGets an object that performs paint operations.

The event data class exposes the following methods:

MethodDescription
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:

csharp
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;
}
vb
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

BaseGallery Class

BaseGallery Members

DevExpress.XtraBars.Ribbon.Gallery Namespace