C# Winform: How to set the Base Color of a TabControl (not the tabpage) -


This seems like a simple question, but how do I set the background color of the 'tab control', it seems standard windows Is it possible to create a black tab control with the white text written on the tabs by theme colors? (Not on tab page)?

Help, I am slightly familiar with custom control while increasing current controls but I do not know what to set properties (if they exist).

  Private Zero Tab Control 1_DrawItem (Object Sender, System. Windows.Forms.DrawItemEventArgs e) {TabPage CurrentTab = tabControl1.TabPages [e.Index]; Rectangle ItemRect = tabControl1.GetTabRect (E. Indexes); Solidbrush filibh = new solidbrush (color red); Solidbrush textbrush = new solidbrush (color white); String formatting sf = new string formatting (); Sf.Alignment = StringAlignment.Center; Sf.LineAlignment = String alignment. center; // If we are currently displaying the selected tab items, then we will change the brush color and increase the rectangle if I (system.convert.toBoolean (e.State and DrawItemState.Selected)) {FillBrush.Color = Color.White; TextBrush.Color = Color.Red; ItemRect.Inflate (2, 2); } // If set the rotation for the left and right aligned tabs (tabControl1.Alignment == TabAlignment.Left = tabControl1.Alignment == TabAlignment.Right) {float RotateAngle = 90; If (tabControl1.Alignment == TabAlignment.Left) RotateAngle = 270; PointF CP = new point (Madric Lift + (Madrakt Width / 2), Madrift. + (Madric / Height / 2)); E.Graphics.TranslateTransform (cp.X, cp.Y); E.Graphics.RotateTransform (RotateAngle); Madricks = New Rectangle (- (Madric. Heights / 2), - (Madrakt Width / 2), Madrakt Height, Madrakt Width); } // Next, we have our fill brush. TabItem will paint with graphics. Philarctangle (filibs, madrice); // Now drag the text E.Graphics.DrawString (CurrentTab.Text, E.Font, TextBrush, Rectangle Reference Item, SF); // Reset any graphics rotation e.Graphics.ResetTransform (); // Finally, we should dispose of our brush FillBrush.Dispose (); TextBrush.Dispose (); }  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -