Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8358587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:50:54+00:00 2026-06-09T10:50:54+00:00

Ex |Tab1|Tab2|Tab3| { } | | | | | | | | |_____________________| I

  • 0

Ex

  |Tab1|Tab2|Tab3| {    }
  |                     |
  |                     |
  |                     |
  |                     |
  |_____________________|

I am able to change the backcolor and forecolor of Tab.. but I want to change the color of that { } — > Empty space is this possible to do that. .. It shows default winforms color..help me in dis..

 private void Form1_Load(object sender, EventArgs e)
    {

    }


    private void tabControl1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
    {
        Font fntTab;
        Brush bshBack;
        Brush bshFore;

        if ( e.Index == this.tabControl1.SelectedIndex)
        {
            fntTab = new Font(e.Font, FontStyle.Bold);
            bshBack = new System.Drawing.Drawing2D.LinearGradientBrush(e.Bounds, SystemColors.Control, SystemColors.Control, System.Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal);
            bshFore = Brushes.Black;
            //bshBack = new System.Drawing.Drawing2D.LinearGradientBrush(e.Bounds, Color.LightSkyBlue , Color.LightGreen, System.Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal);
            //bshFore = Brushes.Blue;
        }
        else
        {
            fntTab = e.Font;
            bshBack = new SolidBrush(Color.Red);
            bshFore = new SolidBrush(Color.Aqua);

            //bshBack = new SolidBrush(Color.White);
            //bshFore = new SolidBrush(Color.Black);
        }

        string tabName  = this.tabControl1.TabPages[e.Index].Text;
        StringFormat sftTab = new StringFormat();
        e.Graphics.FillRectangle(bshBack, e.Bounds);
        Rectangle  recTab = e.Bounds;
        recTab = new Rectangle( recTab.X,  recTab.Y + 4,  recTab.Width,  recTab.Height - 4);
        e.Graphics.DrawString(tabName, fntTab, bshFore, recTab, sftTab);

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:50:55+00:00Added an answer on June 9, 2026 at 10:50 am

    I think the only way to give that space a color is to override the OnPaintBackground method of the window, so just paste this on your form (window)

    you must also change the Appearance Property to “Normal”

    private void Form1_Load(object sender, EventArgs e)
    {
    
    }
    
    protected override void OnPaintBackground(PaintEventArgs e)
    {
        base.OnPaintBackground(e);
        Rectangle lasttabrect = tabControl1.GetTabRect(tabControl1.TabPages.Count - 1);
        RectangleF emptyspacerect = new RectangleF(
                lasttabrect.X + lasttabrect.Width + tabControl1.Left,
                tabControl1.Top + lasttabrect.Y, 
                tabControl1.Width - (lasttabrect.X + lasttabrect.Width), 
                lasttabrect.Height);
    
        Brush b = Brushes.BlueViolet; // the color you want
        e.Graphics.FillRectangle(b, emptyspacerect );
    }
    

    for me it’s working perfectly

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Tab1, Tab2 and Tab3... All tabs have inputs that are validated ...
I have 2 Tabs - Tab1 and Tab2, Tab1Activity and Tab2Activity. I want to
In tab container let say I have two tabs [Tab1 & Tab2] Tab1 has
Hi Initally tab1 is enabled and tab2,tab3 are in disable mode. by clicking 1st
I have worked in tab bar, using TabHost to develop the tab1, tab2 and
I have following a tags: <a href=#tab1>Any tab1 Label</a> <a href=#tab2>tab2 Label</a> <a href=#tab3>Any
<div class=nav-top> <ul> <li class=test tab1><a href=/>test</a></li> <li class=tes tab2><a href=#>test</a></li> <li class=tes tab3><a
<div class=nav-top> <ul> <li class=tab1><a href=/>test</a></li> <li class=tab2><a href=#>test</a></li> <li class=tab3><a href=#>test</a></li> <li class=navahead><a
SELECT * FROM TAB1 LEFT JOIN TAB2 ON TAB2.ID_TAB1 = TAB1.ID JOIN TAB3 ON
HI, I have a database with 3 tables TAB1, TAB2, TAB3 which have exactly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.