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

DrawTabBorder() private method

private DrawTabBorder ( Graphics g, TabPage tabPage, Point pt, bool isSelected, Rectangle &recBounds ) : void
g System.Drawing.Graphics
tabPage System.Windows.Forms.TabPage
pt Point
isSelected bool
recBounds System.Drawing.Rectangle
return void
        private void DrawTabBorder( Graphics g, TabPage tabPage, Point[] pt, bool isSelected, ref Rectangle recBounds )
        {
            //-------------------//
            //--- draw border ---//
            //-------------------//
            g.DrawPolygon( SystemPens.ControlDark, pt );

            if (isSelected)
            {
                //----------------------------
                // clear bottom lines
                using (var pen = new Pen( tabPage.BackColor ))
                {
                    switch (Alignment)
                    {
                        case TabAlignment.Top:
                            g.DrawLine( pen, recBounds.Left + 1, recBounds.Bottom, recBounds.Right - 1, recBounds.Bottom );
                            g.DrawLine( pen, recBounds.Left + 1, recBounds.Bottom + 1, recBounds.Right - 1,
                                        recBounds.Bottom + 1 );
                            break;

                        case TabAlignment.Bottom:
                            g.DrawLine( pen, recBounds.Left + 1, recBounds.Top, recBounds.Right - 1, recBounds.Top );
                            g.DrawLine( pen, recBounds.Left + 1, recBounds.Top - 1, recBounds.Right - 1,
                                        recBounds.Top - 1 );
                            g.DrawLine( pen, recBounds.Left + 1, recBounds.Top - 2, recBounds.Right - 1,
                                        recBounds.Top - 2 );
                            break;
                    }

                    pen.Dispose();
                }
                //----------------------------
            }
            //----------------------------
        }