Bonsoir, je me suis crée une class trackbar mais j'ai un petit souci avec mon code Drawline.

Nom : Capture d’écran 2021-12-17 172106.png
Affichages : 247
Taille : 1,6 Ko

j'arrive pas positionner la valeur maximum jusqu'à la fin drawline comme sur la flèche rouge.

mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
Private Sub DrawLine(g As Graphics, Rect As Rectangle)
        g.DrawLine(New Pen(Brushes.Black, 1), New Point(CInt(Rect.X + 8), Rect.Height / 2), New Point(CInt(Rect.Width - 10), Rect.Height / 2))
        For i = Minimum To Maximum
            If i Mod 20 = 0 Then
                g.DrawLine((New Pen(Brushes.Black, 1)), CInt((Rect.X + 8) + i), CInt(Rect.Height / 2), CInt((Rect.X + 8) + i), CInt(Rect.Height / 1.5))
                g.DrawString(i.ToString, Me.Font, Brushes.Black, New Point(CInt((Rect.X + 8) + i), Rect.Height / 1.5), New StringFormat With {.Alignment = StringAlignment.Center})
            End If
        Next
    End Sub
avez-vous une autre solution pour positionner la valeur maximum jusqu'à la fin drawline (flèche rouge comme l'image). merci d'avance