Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Can someone help me to convert the below vb5 code to vb.net code.

Can someone help me to convert the below vb5 code to vb.net code.

Scheduled Pinned Locked Moved Visual Basic
csharpjavahelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kusal
    wrote on last edited by
    #1

    '////////////////////////////////////////////////////////////////// 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.

    C N 2 Replies Last reply
    0
    • K Kusal

      '////////////////////////////////////////////////////////////////// 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.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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 )

      1 Reply Last reply
      0
      • K Kusal

        '////////////////////////////////////////////////////////////////// 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.

        N Offline
        N Offline
        Navneet Hegde
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups