windowsforms-devexpress-dot-xtrabars-dot-docking2010-dot-views-dot-baseview-bd3be6eb.md
Occurs when the current View’s background becomes visible to an end-user.
Namespace : DevExpress.XtraBars.Docking2010.Views
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public event CustomDrawBackgroundEventHandler CustomDrawBackground
Public Event CustomDrawBackground As CustomDrawBackgroundEventHandler
The CustomDrawBackground event's data class is DevExpress.XtraBars.Docking2010.CustomDrawBackgroundEventArgs.
You can set a View’s background via the BaseView.BackgroundImage property. Use the BaseView.BackgroundImageLayoutMode property to customize its layout. If these properties are insufficient for your needs (for instance, if you want to display a background image at specific point, or show several images), handle the CustomDrawBackground event and access via its argument a System.Drawing.Graphics class, which encapsulates a GDI+ drawing surface. The code below illustrates how 2 images can be displayed as the View’s background.
private void tabbedView1_CustomDrawBackground(object sender, CustomDrawBackgroundEventArgs e) {
e.GraphicsCache.DrawImage(global::documentManager.Properties.Resources.Image1, new Point(0, 0));
e.GraphicsCache.DrawImage(global::documentManager.Properties.Resources.Image2, new Point(400, 0));
}
Private Sub tabbedView1_CustomDrawBackground(ByVal sender As Object, ByVal e As CustomDrawBackgroundEventArgs)
e.GraphicsCache.DrawImage(Global.documentManager.My.Resources.Image1, New Point(0, 0))
e.GraphicsCache.DrawImage(Global.documentManager.My.Resources.Image2, New Point(400, 0))
End Sub
See the System.Drawing.Graphics class at MSDN to learn more.
See Also