I think this will do..: http://www.programme...93/tab-control/
This post has been edited by JohnorSky: 13 September 2009 - 08:57 PM
Posted 13 September 2009 - 08:41 PM
This post has been edited by JohnorSky: 13 September 2009 - 08:57 PM
Posted 14 September 2009 - 01:28 AM
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TabControl1.DrawMode = TabDrawMode.OwnerDrawFixed End Sub Add this sub to your program. It colors the Tab (not the page) the same colors as the background of the tab, if it is the one selected. The other tabs are colored a standard white with black text. You can modify it anyway you want, but it seems to work very well for coloring the tabs. Private Sub TabControl1_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles TabControl1.DrawItem Dim g As Graphics = e.Graphics Dim tp As TabPage = TabControl1.TabPages(e.Index) Dim br As Brush Dim sf As New StringFormat Dim r As New RectangleF(e.Bounds.X, e.Bounds.Y + 2,e.Bounds.Width, e.Bounds.Height - 2) sf.Alignment = StringAlignment.Center Dim strTitle As String = tp.Text 'If the current index is the Selected Index, change the color If TabControl1.SelectedIndex = e.Index Then 'this is the background color of the tabpage 'you could make this a stndard color for the selected page br = New SolidBrush(tp.BackColor) 'this is the background color of the tab page g.FillRectangle(br, e.Bounds) 'this is the background color of the tab page 'you could make this a stndard color for the selected page br = New SolidBrush(tp.ForeColor) g.DrawString(strTitle, TabControl1.Font, br, r, sf) Else 'these are the standard colors for the unselected tab pages br = New SolidBrush(Color.WhiteSmoke) g.FillRectangle(br, e.Bounds) br = New SolidBrush(Color.Black) g.DrawString(strTitle, TabControl1.Font, br, r, sf) End If End Sub