Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help needed with PrintDocument and WithEvents

Status
Not open for further replies.

BLJ10

Programmer
Jan 5, 2008
4
US
Public Class Form1

Private Sub PrintDocument1(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage

End Sub
End Class

When I try to debug this I get the following error:
Handles clause requires a WithEvents variable defined in the containing type or one of its base types

Anyone know what is wrong? It is my last error. This is written with Visual Studio 2005. Thanks for any help.
 
Yes, I did drop the printdocument onto the form.
 
Does it print anything or does it just give the error when debugging?

If you look at the designer code does it have a withevents statement where it says "dim printdocument1 as printdocument"? That would then be "dim withevents printdocument1 as printdocument".

Christiaan Baes
Belgium

My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top