ATMLCommonLibrary.controls.awb.AWBTabControl.DrawBackgroundFix C# (CSharp) Method

DrawBackgroundFix() private method

private DrawBackgroundFix ( Graphics g, Rectangle &tabArea ) : void
g System.Drawing.Graphics
tabArea System.Drawing.Rectangle
return void
        private void DrawBackgroundFix( Graphics g, ref Rectangle tabArea )
        {
            //--------------------------------------------------//
            //--- draw background to cover flat border areas ---//
            //--------------------------------------------------//
            if (SelectedTab != null)
            {
                TabPage tabPage = SelectedTab;
                Color color = tabPage.BackColor;
                using (var border = new Pen( color ))
                {
                    tabArea.Offset( 1, 1 );
                    tabArea.Width -= 2;
                    tabArea.Height -= 2;

                    g.DrawRectangle( border, tabArea );
                    tabArea.Width -= 1;
                    tabArea.Height -= 1;
                    g.DrawRectangle( border, tabArea );

                    border.Dispose();
                }
            }
        }