S
Samuel Lee
Could anyone convert the following vb 6.0 codes into vb.net version?
'************************************************************************
'** Button to print a sales receipt - spool print data to receipt printer
'************************************************************************
Private Sub cmdPrintReceipt_Click()
Printer.CurrentX = 0: Printer.CurrentY = 0
Printer.FontName = "Arial"
'Print header
Printer.FontBold = True
Printer.CurrentX = 60
Printer.Print "SALES HEADER"
Printer.FontBold = False
Printer.CurrentX = 90
Printer.Print "Sales Description"
Printer.Print 'Print blank line
Printer.EndDoc 'End document to print
End Sub
I don't have problem printing receipt in vb 6.0 running on Win98? After I
converted it into vb.net I only manage to print receipt for the first time
on Win98 but I don't have problem on Win2K. I got the following error the
moment I print the second time on Win98.
System.NullReferenceException
Object reference not set to an instance of an object.
This error occurred at MyDoc.Print() where MyDoc is declared as below:
Private MyDoc As New PrintDocument()
Any idea?
'************************************************************************
'** Button to print a sales receipt - spool print data to receipt printer
'************************************************************************
Private Sub cmdPrintReceipt_Click()
Printer.CurrentX = 0: Printer.CurrentY = 0
Printer.FontName = "Arial"
'Print header
Printer.FontBold = True
Printer.CurrentX = 60
Printer.Print "SALES HEADER"
Printer.FontBold = False
Printer.CurrentX = 90
Printer.Print "Sales Description"
Printer.Print 'Print blank line
Printer.EndDoc 'End document to print
End Sub
I don't have problem printing receipt in vb 6.0 running on Win98? After I
converted it into vb.net I only manage to print receipt for the first time
on Win98 but I don't have problem on Win2K. I got the following error the
moment I print the second time on Win98.
System.NullReferenceException
Object reference not set to an instance of an object.
This error occurred at MyDoc.Print() where MyDoc is declared as below:
Private MyDoc As New PrintDocument()
Any idea?