Private Sub Form1_Paint(ByVal sender As Object, ByVal e As _
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim y As Integer = 0
DrawSample(e.Graphics, y, "CaptionFont", _
SystemFonts.CaptionFont)
DrawSample(e.Graphics, y, "DefaultFont", _
SystemFonts.DefaultFont)
DrawSample(e.Graphics, y, "DialogFont", _
SystemFonts.DialogFont)
DrawSample(e.Graphics, y, "IconTitleFont", _
SystemFonts.IconTitleFont)
DrawSample(e.Graphics, y, "MenuFont", _
SystemFonts.MenuFont)
DrawSample(e.Graphics, y, "MessageBoxFont", _
SystemFonts.MessageBoxFont)
DrawSample(e.Graphics, y, "SmallCaptionFont", _
SystemFonts.SmallCaptionFont)
DrawSample(e.Graphics, y, "StatusFont", _
SystemFonts.StatusFont)
End Sub
Private Sub DrawSample(ByVal gr As Graphics, ByRef y As _
Integer, ByVal font_name As String, ByVal sample_font _
As Font)
gr.DrawString(font_name, sample_font, Brushes.Black, _
10, y)
y += CInt(gr.MeasureString(font_name, _
sample_font).Height * 1.1)
End Sub
|