Re: Printing Issue
- From: "Alex Clark" <quanta_xp@xxxxxxxxxxxxxxxx>
- Date: Tue, 6 Sep 2005 13:54:28 +0100
Hi,
Sample code below. Please note that the exception is thrown when attempting
to show the print preview dialog in its CreateHandle method.
>>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
If dlgPreview.ShowDialog = DialogResult.OK Then
pdocTest.Print()
End If
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
Private Sub pdocTest_PrintPage(ByVal sender As System.Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs) Handles pdocTest.PrintPage
With e.Graphics
..DrawRectangle(Pens.Black, New Rectangle(25, 25, 40, 40))
..DrawString("This is a test document", Me.Font, Brushes.Black, 30, 30)
..DrawEllipse(Pens.Black, 40, 80, 20, 20)
e.HasMorePages = False
End With
End Sub
>>
.
- Follow-Ups:
- Re: Printing Issue
- From: "Jeffrey Tan[MSFT]"
- Re: Printing Issue
- References:
- Printing Issue
- From: Alex Clark
- Re: Printing Issue
- From: Collin Bennett
- Printing Issue
- Prev by Date: Re: Windows Form Application Performance Issues
- Next by Date: Re: Combobox refresh in tab page
- Previous by thread: Re: Printing Issue
- Next by thread: Re: Printing Issue
- Index(es):