1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
Private Sub TabControl1_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles TabControl1.DrawItem
Dim f As Font = New Font(e.Font, FontStyle.Bolds)
Dim b As New SolidBrush(Color.Black)
'CLIENTS
If e.Index = 0 Then
'On choisi la couleur ici
e.Graphics.FillRectangle(Brushes.LightGreen, e.Bounds)
'Ici vient se placer aussi des modifications de la font du texte de l'onglet (type, taille couleur au travers d'un objet de type Font) et positionnement (le X et le Y)
e.Graphics.DrawString(TabControl1.TabPages(e.Index).Text, Me.Font, Brushes.Black, e.Bounds.X + 1, e.Bounds.Y + 3)
End If
'COMPLEMENT
If e.Index = 1 Then
e.Graphics.FillRectangle(Brushes.LightSalmon, e.Bounds)
e.Graphics.DrawString(TabControl1.TabPages(e.Index).Text, Me.Font, Brushes.Black, e.Bounds.X + 1, e.Bounds.Y + 3)
End If
'Ici exemple de 2 onglets, mais on peut en mettre plus ....
End Sub |
Partager