Private Sub Form1_Paint(ByVal sender As Object, ByVal e As _
System.Windows.Forms.PaintEventArgs) Handles _
MyBase.Paint
e.Graphics.FillRectangle(Brushes.White, 0, 0, 55, _
Me.ClientSize.Height)
Dim y As Integer = 10
DrawLineSample(e.Graphics, y, _
SystemPens.ActiveCaptionText, "ActiveCaptionText")
DrawLineSample(e.Graphics, y, SystemPens.Control, _
"Control")
DrawLineSample(e.Graphics, y, SystemPens.ControlDark, _
"ControlDark")
DrawLineSample(e.Graphics, y, _
SystemPens.ControlDarkDark, "ControlDarkDark")
DrawLineSample(e.Graphics, y, SystemPens.ControlLight, _
"ControlLight")
DrawLineSample(e.Graphics, y, SystemPens.ControlText, _
"ControlText")
DrawLineSample(e.Graphics, y, SystemPens.GrayText, _
"GrayText")
DrawLineSample(e.Graphics, y, SystemPens.Highlight, _
"Highlight")
DrawLineSample(e.Graphics, y, SystemPens.HighlightText, _
"HighlightText")
DrawLineSample(e.Graphics, y, _
SystemPens.InactiveCaptionText, _
"InactiveCaptionText")
DrawLineSample(e.Graphics, y, SystemPens.InfoText, _
"InfoText")
DrawLineSample(e.Graphics, y, SystemPens.MenuText, _
"MenuText")
DrawLineSample(e.Graphics, y, SystemPens.WindowFrame, _
"WindowFrame")
DrawLineSample(e.Graphics, y, SystemPens.WindowText, _
"WindowText")
End Sub
Private Sub DrawLineSample(ByVal gr As Graphics, ByRef y As _
Integer, ByVal the_pen As Pen, ByVal pen_name As String)
gr.DrawLine(the_pen, 10, y, 100, y)
y -= CInt(0.5 * gr.MeasureString(pen_name, _
Me.Font).Height)
gr.DrawString(pen_name, Me.Font, Brushes.Black, 110, y)
y += CInt(1.6 * gr.MeasureString(pen_name, _
Me.Font).Height)
End Sub
|