Jan 18, 2016

tab control selected tab color

protected override void OnDrawItem(DrawItemEventArgs e)
        {
            if (this.SelectedIndex == e.Index)
            {
                RectangleF retangulo = this.GetTabRect(e.Index);
                e.Graphics.FillRectangle(Brushes.DarkBlue, retangulo);
            }
            e.Graphics.DrawString("x", e.Font, Brushes.Red, e.Bounds.Right - 15, e.Bounds.Top + 4);
            e.Graphics.DrawString(this.TabPages[e.Index].Text, e.Font, Brushes.Black, e.Bounds.Left + 12, e.Bounds.Top + 4);
            e.DrawFocusRectangle();
        }

0 comments:

Post a Comment

Nam Le © 2014 - Designed by Templateism.com, Distributed By Templatelib