logo
VitNX3 Documentation

# VitNX_DockGroup.OnPaint Method

Namespace: VitNX.UI.ControlsV1.Docking
Assembly: VitNX3 (in VitNX3.dll)
Raises the Paint event.
VB
C#
F#
C++
JScript
Copy

    protected override void OnPaint(
       PaintEventArgs e
    )

    This language is not supported or no code example is available.

#### Parameters

e
  PaintEventArgs

A PaintEventArgs that contains the event data.

Source code
VB
C#
F#
C++
JScript
Copy

    protected override void OnPaint(PaintEventArgs e)
     {
         var g = e.Graphics;
         using (var b = new SolidBrush(Colors.GreyBackground))
             g.FillRectangle(b, ClientRectangle);
         if (!_tabArea.Visible)
             return;
         using (var b = new SolidBrush(Colors.MediumBackground))
             g.FillRectangle(b, _tabArea.ClientRectangle);
         foreach (var tab in _tabs.Values)
         {
             if (DockArea == VitNX_DockArea.Document)
                 PaintDocumentTab(g, tab);
             else
                 PaintToolWindowTab(g, tab);
         }
         if (DockArea == VitNX_DockArea.Document)
         {
             var isActiveGroup = DockPanel.ActiveGroup == this;
             var divColor = isActiveGroup ? Colors.BlueSelection : Colors.GreySelection;
             using (var b = new SolidBrush(divColor))
             {
                 var divRect = new Rectangle(_tabArea.ClientRectangle.Left,
                     _tabArea.ClientRectangle.Bottom - 2,
                     _tabArea.ClientRectangle.Width, 2);
                 g.FillRectangle(b, divRect);
             }
             var dropdownRect = new Rectangle(_tabArea.DropdownRectangle.Left,
                 _tabArea.DropdownRectangle.Top,
                 _tabArea.DropdownRectangle.Width,
                 _tabArea.DropdownRectangle.Height - 2);
             using (var b = new SolidBrush(Colors.MediumBackground))
                 g.FillRectangle(b, dropdownRect);
             using (var img = DockIcons.arrow)
                 g.DrawImageUnscaled(img, dropdownRect.Left + (dropdownRect.Width / 2) - (img.Width / 2),
                     dropdownRect.Top + (dropdownRect.Height / 2) - (img.Height / 2) + 1);
         }
     }

    This language is not supported or no code example is available.

Applies to

#### .NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

#### .NET Core

Supported in: 5.0+, 6.0+
See Also
VitNX_DockGroup Class
VitNX.UI.ControlsV1.Docking Namespace