2012-06-04 63 views
1

我正在Geckofx上运行的浏览器上工作,以及我无法找到更改TabControl颜色的方法 我不想更改标签页,我想更改容器。TabControl的背景颜色?

这里就是我的意思是:

这就是我想要做的事:

enter image description here

这是我在哪里:

enter image description here

我已经使用这个标签

private void tabControl_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) 
    { 
     { 
      TabPage CurrentTab = tabControl.TabPages[e.Index]; 
      Rectangle ItemRect = tabControl.GetTabRect(e.Index); 
      SolidBrush FillBrush = new SolidBrush(Color.Red); 
      SolidBrush FBG = new SolidBrush(Color.Black); 
      SolidBrush TextBrush = new SolidBrush(Color.Green); 
      StringFormat sf = new StringFormat(); 
      sf.Alignment = StringAlignment.Center; 
      sf.LineAlignment = StringAlignment.Center; 
      if (System.Convert.ToBoolean(e.State & DrawItemState.Selected)) 
      { 
       FillBrush.Color = Color.Black; 
       TextBrush.Color = Color.Green; 
       ItemRect.Inflate(0, 0); 
      } 

      if (tabControl.Alignment == TabAlignment.Left || tabControl.Alignment == TabAlignment.Right) 
      { 
       float RotateAngle = 90; 
       if (tabControl.Alignment == TabAlignment.Left) 
        RotateAngle = 270; 
       PointF cp = new PointF(ItemRect.Left + (ItemRect.Width/3), ItemRect.Top + (ItemRect.Height/5)); 
       e.Graphics.TranslateTransform(cp.X, cp.Y); 
       e.Graphics.RotateTransform(RotateAngle); 
       ItemRect = new Rectangle(-(ItemRect.Height/3), -(ItemRect.Width/3), ItemRect.Height, ItemRect.Width); 
      } 
      e.Graphics.FillRectangle(FillBrush, ItemRect); 
      e.Graphics.DrawString(CurrentTab.Text, e.Font, TextBrush, (RectangleF)ItemRect, sf); 
      e.Graphics.ResetTransform(); 
      FillBrush.Dispose(); 
      TextBrush.Dispose(); 
     } 
    } 

我只是不知道如何改变的TabControl的

我看过了网上随处可见的颜色和实例要么由0任何意义或没有工作。

我知道这可以从我见过的例子

任何人都可以帮忙吗?

回答