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. Convert coding VB 5.0 to VB.Net 2003

Convert coding VB 5.0 to VB.Net 2003

Scheduled Pinned Locked Moved Visual Basic
csharpjava
4 Posts 2 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

    Hi, I need to convert this coding VB 5.0 to VB.Net 2003. This print button coding in billing system. I use BIXOLON SAMSUNG SRP-275 mini printer. There was sample coding but it's in VB 5.0. But I write my program in VB.Net 2003. This is the coding...... '////////////////////////////////////////////////////////////////// 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 Pri

    K 1 Reply Last reply
    0
    • K Kusal

      Hi, I need to convert this coding VB 5.0 to VB.Net 2003. This print button coding in billing system. I use BIXOLON SAMSUNG SRP-275 mini printer. There was sample coding but it's in VB 5.0. But I write my program in VB.Net 2003. This is the coding...... '////////////////////////////////////////////////////////////////// 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 Pri

      K Offline
      K Offline
      Kevin McFarlane
      wrote on last edited by
      #2

      Do you have access to VB 6? If so then you could try creating a VB 6 version and then using the VB conversion Wizard in VB .NET to convert from VB 6 to VB .NET. It probably won't give perfect results but it will be a start. You can then correct the problematic bits by hand.

      Kevin

      K 2 Replies Last reply
      0
      • K Kevin McFarlane

        Do you have access to VB 6? If so then you could try creating a VB 6 version and then using the VB conversion Wizard in VB .NET to convert from VB 6 to VB .NET. It probably won't give perfect results but it will be a start. You can then correct the problematic bits by hand.

        Kevin

        K Offline
        K Offline
        Kusal
        wrote on last edited by
        #3

        Tannks Regards Kusal

        1 Reply Last reply
        0
        • K Kevin McFarlane

          Do you have access to VB 6? If so then you could try creating a VB 6 version and then using the VB conversion Wizard in VB .NET to convert from VB 6 to VB .NET. It probably won't give perfect results but it will be a start. You can then correct the problematic bits by hand.

          Kevin

          K Offline
          K Offline
          Kusal
          wrote on last edited by
          #4

          Dear Kevin, I covert it. but there was many errors. Pls, Give any help to solve it. Regards Kusal '/////////////////////////////////////////////////////////////////////// Option Strict Off Option Explicit On Friend Class MainForm Inherits System.Windows.Forms.Form #Region "Windows Form Designer generated code " Public Sub New() MyBase.New() If m_vb6FormDefInstance Is Nothing Then If m_InitializingDefInstance Then m_vb6FormDefInstance = Me Else Try 'For the start-up form, the first instance created is the default instance. If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then m_vb6FormDefInstance = Me End If Catch End Try End If End If 'This call is required by the Windows Form Designer. InitializeComponent() End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean) If Disposing Then If Not components Is Nothing Then components.Dispose() End If End If MyBase.Dispose(Disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer Public ToolTip1 As System.Windows.Forms.ToolTip Public WithEvents Command1 As System.Windows.Forms.Button 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Private Sub InitializeComponent() Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(MainForm)) Me.components = New System.ComponentModel.Container() Me.ToolTip1 = New System.Windows.Forms.ToolTip(components) Me.ToolTip1.Active = True Me.Command1 = New System.Windows.Forms.Button Me.Text = "Sample Program" Me.ClientSize = New System.Drawing.Size(218, 115) Me.Location = New System.Drawing.Point(4, 30) Me.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation Me.Font = New System.Drawing.Font("Arial", 8!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.BackColor = System.Drawing.SystemColors.Control Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable Me.ControlBox = True Me.Enabled = True Me.KeyPreview = False Me.MaximizeBox = True Me.MinimizeBox = True Me.

          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