Posted 20 April 2020, 7:27 am EST - Updated 3 October 2022, 11:59 pm EST
I want to migrate a VS2019 PrintPreviewDialog to the better featured C1PrintPreviewDialog. The VS PrintPreviewDialog owned a PrintDocument and it is very easy to write a text and draw a line. See the result of this minimum 2 line code in the attached picture.
Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim g As Graphics = e.Graphics
g.DrawString(“Zu druckender Text”, New Font(“Courier New”, 12), Brushes.Black, 0, 0)
g.DrawLine(New Pen(Color.Red, 5), 0, 0, 200, 200)
End Sub
Migrated to C1PrintDocument it is not possible to get a “Graphics” object from the “EventArg” parameter, where I can paint.
Dim g As Graphics = e.Graphics
“Graphics” is no Member from “EventArgs” !!!
What lesson I have to learn, to understand the procedure?
In the C1SampleExplorer I have nothing found?
Where can I find simple samples to understand that all?
Many thanks for each answer, Jürgen (Germany)