Can someone help me to convert the below vb5 code to vb.net code.
-
'////////////////////////////////////////////////////////////////// Private Sub Command1_Click() For Each prnPrinter In Printers If prnPrinter.DeviceName = "BIXOLON SAMSUNG SRP-275" Then Set Printer = prnPrinter Exit For End If Next If Printer.DeviceName = "BIXOLON SAMSUNG SRP-275" Then Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "x" Printer.Font.Size = 9 Printer.FontName = "FontA2x1" Printer.Font.Bold = True Printer.Print "* Joshua Cafe *" + vbCrLf Printer.Font.Bold = False Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "w" Printer.Font.Size = 9 Printer.FontName = "FontA1x1" Printer.Print " 3000 Spring Street, Rancho," Printer.Print " California 10093," Printer.Print " Tel) 858-519-3698 Fax) 3852" Printer.Print vbCrLf + "---------------------------------" 'LF Printer.Print "Orange Juice 5.00" Printer.Print "6 Bufalo Wing 24.00" Printer.Print "Potato Skin 12.00" Printer.Font.Bold = True Printer.ForeColor = RGB(255, 0, 0) Printer.Print "Subtotal 41.00" Printer.ForeColor = RGB(0, 0, 0) Printer.Font.Bold = False Printer.Print "Tax 6% 2.46" Printer.Font.Bold = True Printer.ForeColor = RGB(255, 0, 0) Printer.Print "Member Discount 2.30" Printer.ForeColor = RGB(0, 0, 0) Printer.Font.Bold = False Printer.Font.Bold = True Printer.Print "Cash 100.00" Printer.Print "Amt. Paid 41.16" Printer.Font.Bold = False Printer.Font.Bold = True Printer.ForeColor = RGB(255, 0, 0) Printer.Print "Change Due 58.84" Printer.ForeColor = RGB(0, 0, 0) Printer.Font.Bold = False Printer.Print "---------------------------------" Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "x" Printer.Font.Size = 9 Printer.FontName = "FontA1x1" Printer.Print "Member Number : 452331949" + vbCrLf Printer.Font.Size = 9 Printer.FontName = "FontA1x1" Printer.Font.Bold = True Printer.Print "Have a nice day !" + vbCrLf Printer.Font.Bold = False Printer.Print "Sale Date: 07/01/03" Printer.Print "Time: 12:30:45" Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "w" Dim pic As Picture Set pic = LoadPicture(App.Path & "\free5_100.bmp") Printer.CurrentX = 60 Printer.CurrentY = 5000 Printer.PaintPicture pic, Printer.CurrentX, Printer.CurrentY Printer.CurrentY = Printer.CurrentY + pic.Height Set pic = LoadPicture(App.Path & "\cafeblue208.bmp") Printer.PaintPicture pic, Printer.CurrentX, Printer.CurrentY Printer.CurrentX = 0 Printer.CurrentY = 9000 Printer.Font.Size = 9 Printer.
-
'////////////////////////////////////////////////////////////////// Private Sub Command1_Click() For Each prnPrinter In Printers If prnPrinter.DeviceName = "BIXOLON SAMSUNG SRP-275" Then Set Printer = prnPrinter Exit For End If Next If Printer.DeviceName = "BIXOLON SAMSUNG SRP-275" Then Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "x" Printer.Font.Size = 9 Printer.FontName = "FontA2x1" Printer.Font.Bold = True Printer.Print "* Joshua Cafe *" + vbCrLf Printer.Font.Bold = False Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "w" Printer.Font.Size = 9 Printer.FontName = "FontA1x1" Printer.Print " 3000 Spring Street, Rancho," Printer.Print " California 10093," Printer.Print " Tel) 858-519-3698 Fax) 3852" Printer.Print vbCrLf + "---------------------------------" 'LF Printer.Print "Orange Juice 5.00" Printer.Print "6 Bufalo Wing 24.00" Printer.Print "Potato Skin 12.00" Printer.Font.Bold = True Printer.ForeColor = RGB(255, 0, 0) Printer.Print "Subtotal 41.00" Printer.ForeColor = RGB(0, 0, 0) Printer.Font.Bold = False Printer.Print "Tax 6% 2.46" Printer.Font.Bold = True Printer.ForeColor = RGB(255, 0, 0) Printer.Print "Member Discount 2.30" Printer.ForeColor = RGB(0, 0, 0) Printer.Font.Bold = False Printer.Font.Bold = True Printer.Print "Cash 100.00" Printer.Print "Amt. Paid 41.16" Printer.Font.Bold = False Printer.Font.Bold = True Printer.ForeColor = RGB(255, 0, 0) Printer.Print "Change Due 58.84" Printer.ForeColor = RGB(0, 0, 0) Printer.Font.Bold = False Printer.Print "---------------------------------" Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "x" Printer.Font.Size = 9 Printer.FontName = "FontA1x1" Printer.Print "Member Number : 452331949" + vbCrLf Printer.Font.Size = 9 Printer.FontName = "FontA1x1" Printer.Font.Bold = True Printer.Print "Have a nice day !" + vbCrLf Printer.Font.Bold = False Printer.Print "Sale Date: 07/01/03" Printer.Print "Time: 12:30:45" Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "w" Dim pic As Picture Set pic = LoadPicture(App.Path & "\free5_100.bmp") Printer.CurrentX = 60 Printer.CurrentY = 5000 Printer.PaintPicture pic, Printer.CurrentX, Printer.CurrentY Printer.CurrentY = Printer.CurrentY + pic.Height Set pic = LoadPicture(App.Path & "\cafeblue208.bmp") Printer.PaintPicture pic, Printer.CurrentX, Printer.CurrentY Printer.CurrentX = 0 Printer.CurrentY = 9000 Printer.Font.Size = 9 Printer.
It seems likely to me that the classes to do this will have changed so utterly that your best bet is a rewrite
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
'////////////////////////////////////////////////////////////////// Private Sub Command1_Click() For Each prnPrinter In Printers If prnPrinter.DeviceName = "BIXOLON SAMSUNG SRP-275" Then Set Printer = prnPrinter Exit For End If Next If Printer.DeviceName = "BIXOLON SAMSUNG SRP-275" Then Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "x" Printer.Font.Size = 9 Printer.FontName = "FontA2x1" Printer.Font.Bold = True Printer.Print "* Joshua Cafe *" + vbCrLf Printer.Font.Bold = False Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "w" Printer.Font.Size = 9 Printer.FontName = "FontA1x1" Printer.Print " 3000 Spring Street, Rancho," Printer.Print " California 10093," Printer.Print " Tel) 858-519-3698 Fax) 3852" Printer.Print vbCrLf + "---------------------------------" 'LF Printer.Print "Orange Juice 5.00" Printer.Print "6 Bufalo Wing 24.00" Printer.Print "Potato Skin 12.00" Printer.Font.Bold = True Printer.ForeColor = RGB(255, 0, 0) Printer.Print "Subtotal 41.00" Printer.ForeColor = RGB(0, 0, 0) Printer.Font.Bold = False Printer.Print "Tax 6% 2.46" Printer.Font.Bold = True Printer.ForeColor = RGB(255, 0, 0) Printer.Print "Member Discount 2.30" Printer.ForeColor = RGB(0, 0, 0) Printer.Font.Bold = False Printer.Font.Bold = True Printer.Print "Cash 100.00" Printer.Print "Amt. Paid 41.16" Printer.Font.Bold = False Printer.Font.Bold = True Printer.ForeColor = RGB(255, 0, 0) Printer.Print "Change Due 58.84" Printer.ForeColor = RGB(0, 0, 0) Printer.Font.Bold = False Printer.Print "---------------------------------" Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "x" Printer.Font.Size = 9 Printer.FontName = "FontA1x1" Printer.Print "Member Number : 452331949" + vbCrLf Printer.Font.Size = 9 Printer.FontName = "FontA1x1" Printer.Font.Bold = True Printer.Print "Have a nice day !" + vbCrLf Printer.Font.Bold = False Printer.Print "Sale Date: 07/01/03" Printer.Print "Time: 12:30:45" Printer.Font.Size = 9 Printer.FontName = "FontControl" Printer.Print "w" Dim pic As Picture Set pic = LoadPicture(App.Path & "\free5_100.bmp") Printer.CurrentX = 60 Printer.CurrentY = 5000 Printer.PaintPicture pic, Printer.CurrentX, Printer.CurrentY Printer.CurrentY = Printer.CurrentY + pic.Height Set pic = LoadPicture(App.Path & "\cafeblue208.bmp") Printer.PaintPicture pic, Printer.CurrentX, Printer.CurrentY Printer.CurrentX = 0 Printer.CurrentY = 9000 Printer.Font.Size = 9 Printer.
If you are clear of what you are trying,then better have a new project by this u will be getting more options and tools to enhance your project .
Develop2Program & Program2Develop