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
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
|