vb.net error, need help

dneisler

Member
Joined
Sep 6, 2005
Messages
7
Programming Experience
1-3
I am getting this error when I call a function of mine in a class.

"Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class."

I am not sure what to do to fix it, or totally understand it. Can some one assist me.

Thanks
Donald


Code:
PrintLaserLabel(TheLabel) <- Error is on this line.


Public Sub PrintLaserLabel(ByVal TheLabel As String)
Try
Dim pd As New System.Drawing.Printing.PrintDocument
AddHandler pd.PrintPage, AddressOf PrintDocumentHandler
pd.Print()
UpdateLog(0, "Label Printed!")
Catch ex As Exception
MessageBox.Show("ProcessShipments Error: " & ex.Message)
UpdateLog(3, "LABEL ERROR: " & ex.Message)
End Try
End Sub
 
Back
Top