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