Private Sub cmdPrintVbStyle_Click()
Dim x1 As Long, y1 As Long, x2 As Long, y2 As Long, x3 As _
Long, y3 As Long
' Print something to initialize the printer.
Printer.CurrentX = 1440
Printer.CurrentY = 1440
Printer.Print " "
' Upper left corner.
x1 = 1440 / Printer.TwipsPerPixelX ' 1 inch
y1 = 1440 / Printer.TwipsPerPixelY ' 1 inch
' Lower right corner.
x2 = 5 * 1440 / Printer.TwipsPerPixelX ' 5 inches
y2 = 3 * 1440 / Printer.TwipsPerPixelY ' 3 inches
' Width and height of the corner ellipse.
x3 = 1440 / Printer.TwipsPerPixelX ' 1 inch
y3 = 0.5 * 1440 / Printer.TwipsPerPixelY ' 0.5 inch
' Draw the rounded rectangle.
RoundRect Printer.hdc, x1, y1, x2, y2, x3, y3
Printer.EndDoc
End Sub
|