Sorry, no easy way. The ForeColor and BackColor properties don't work either. If you really need this functionality, you can either create your own control or use someone else’s. You can find a free tab control, among other controls, that does expose color functionality at <a href="http://www.dotnetmagic.com/index.html">Magic User Interface Library for .NET</a>
Set the property TabControl1.DrawMode = OwnerDrawFixed. Modify the appearance in the TabControls DrawItem Event.
Private Sub TabControl1_DrawItem(ByVal sender As Object, _ ByVal e As System.Windows.Forms.DrawItemEventArgs) _ Handles TabControl1.DrawItem
Dim s As String = TabControl1.TabPages(e.Index).Text Dim r As RectangleF = RectangleF.op_Implicit(e.Bounds) Dim TextBrush As New SolidBrush(e.ForeColor) Dim sf As New StringFormat
Disable tabPage?
Unus
I also looked at the CreateItem event, but that didn't seem to help me much.
kbabaria
nmueggler
Modify the appearance in the TabControls DrawItem Event.
Private Sub TabControl1_DrawItem(ByVal sender As Object, _
ByVal e As System.Windows.Forms.DrawItemEventArgs) _
Handles TabControl1.DrawItem
Dim s As String = TabControl1.TabPages(e.Index).Text
Dim r As RectangleF = RectangleF.op_Implicit(e.Bounds)
Dim TextBrush As New SolidBrush(e.ForeColor)
Dim sf As New StringFormat
sf.Alignment = StringAlignment.Center
sf.LineAlignment = StringAlignment.Center
If Not DirectCast(sender, TabControl).TabPages(e.Index).Enabled Then
TextBrush.Color = SystemColors.GrayText
End If
e.Graphics.DrawString(s, e.Font, TextBrush, r, sf)
TextBrush.Dispose()
sf.Dispose()
End Sub