5 Replies - 4576 Views - Last Post: 04 February 2010 - 06:13 AM Rate Topic: -----

#1 Pertoh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 31-August 09

Vb6 to vb.net Upgrade Problems! Please Help.

Posted 02 February 2010 - 03:49 AM

I am trying to Upgrade my vb6 project to vb.net and i have encounterd an error that i cannot solve alone. Will anyone please help me out. its a Listview Problem
Heres the Code.
Private Sub tvTreeView_NodeClick(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles tvTreeView.NodeMouseClick
		Dim Node As System.Windows.Forms.TreeNode = eventArgs.Node
		Dim z As Object
		Dim rptReport As Object
		Select Case Node.Name
			Case "explorer", "accounts", "billing", "tool", "prints", "viewer", "help"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
			Case "newaccount"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
				frmNewAccounts.Show()
			Case "bills"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
				frmBillingForm.Show()
			Case "pay"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
				frmPayment.Show()
			Case "receipt"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
				frmPrint.Show()
			Case "individual"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
				frmPrint2.Show()
			Case "all"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
				On Error GoTo Err_Renamed
				DataEnvironment1.rsCommand1.let_Source("SELECT TBilling.AccountNumber, TAccount.FullName, TAccount.Address, TAccount.Brand, TAccount.MeterNumber, TAccount.TypeOfConnection, TBilling.CubicMeterUsed, TBilling.Date, TBilling.Others, TBilling.PaymentWithDeduction, TBilling.Penalty, TBilling.PresReading, TBilling.PrevReading FROM TBilling, TAccount, Login WHERE TBilling.AccountNumber = TAccount.AccountNumber")
				DataEnvironment1.rsCommand1.Open()
				'UPGRADE_WARNING: Couldn't resolve default property of object rptReport.Show. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
				rptReport.Show()
				Exit Sub
Err_Renamed: 
				DataEnvironment1.rsCommand1.Close()
				DataEnvironment1.rsCommand1.let_Source("SELECT TBilling.AccountNumber, TAccount.FullName, TAccount.Address, TAccount.Brand, TAccount.MeterNumber, TAccount.TypeOfConnection, TBilling.CubicMeterUsed, TBilling.Date, TBilling.Others, TBilling.PaymentWithDeduction, TBilling.Penalty, TBilling.PresReading, TBilling.PrevReading FROM TBilling, TAccount, Login WHERE TBilling.AccountNumber = TAccount.AccountNumber")
			Case "useroption"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
				frmUserOption.Show()
			Case "header"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
				frmHeader.Show()
			Case "viewall"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
				frmViewAll.Show()
			Case "viewindividual"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
				frmViewAccounts.Show()
			Case "about"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.LargeIcon
				lvListView.Items.Clear()
				frmAbout.Show()
			Case "a1"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.Details
				lvListView.FullRowSelect = True
				lvListView.LabelEdit = False
				lvListView.Sort()
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
                z = lvListView.Columns.Insert(1, "", "Account Number", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(2, "", "Lastname", CInt(VB6.TwipsToPixelsX(2000)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(3, "", "Firstname", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(4, "", "MI", CInt(VB6.TwipsToPixelsX(1000)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(5, "", "Address", CInt(VB6.TwipsToPixelsX(2500)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(6, "", "Brand", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(7, "", "Meter Number", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(8, "", "Type of Connection", CInt(VB6.TwipsToPixelsX(1800)))
				lvSubscribers.lvAddSubscribers(lvListView, pb1)
				pb1.Value = 1
			Case "b1"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.Details
				lvListView.FullRowSelect = True
				lvListView.LabelEdit = False
				lvListView.Sort()
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(1, "", "Account Number", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(2, "", "Name", CInt(VB6.TwipsToPixelsX(2500)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(3, "", "Address", CInt(VB6.TwipsToPixelsX(2500)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(4, "", "Brand", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(5, "", "Meter Number", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(6, "", "Type of Connection", CInt(VB6.TwipsToPixelsX(1800)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(7, "", "Date", CInt(VB6.TwipsToPixelsX(2000)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(8, "", "Present Reading", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(9, "", "Previous Reading", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(10, "", "CuM Used", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(11, "", "Penalty", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(12, "", "Others", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(13, "", "Total Payment", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(14, "", "Status", -2)
				lvBills.lvAddBills(lvListView, pb1)
				pb1.Value = 1
			Case "t1"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.Details
				lvListView.FullRowSelect = True
				lvListView.LabelEdit = False
				lvListView.Sort()
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(1, "", "Username", CInt(VB6.TwipsToPixelsX(3000)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(2, "", "Password", CInt(VB6.TwipsToPixelsX(3000)))
				lvReports.lvAddReports(lvListView, pb1)
				pb1.Value = 1
			Case "p1"
				lvListView.Columns.Clear()
				lvListView.View = System.Windows.Forms.View.Details
				lvListView.FullRowSelect = True
				lvListView.LabelEdit = False
				lvListView.Sort()
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
                z = lvListView.Columns.Insert(1, "", "Account Number", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(2, "", "Name", CInt(VB6.TwipsToPixelsX(2500)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(3, "", "Date", CInt(VB6.TwipsToPixelsX(2000)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(4, "", "Penalty", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(5, "", "Others", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(6, "", "Balance", -2)
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(7, "", "Amount", CInt(VB6.TwipsToPixelsX(1800)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(8, "", "Cash Amount", CInt(VB6.TwipsToPixelsX(1800)))
				'UPGRADE_WARNING: Lower bound of collection lvListView.ColumnHeaders has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
				'UPGRADE_WARNING: Add method in .NET does not produce a value Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C676271D-1A65-46CA-8403-027613C5E565"'
				z = lvListView.Columns.Insert(9, "", "Payment Type", -2)
				lvPayments.lvAddPayments(lvListView, pb1)
				pb1.Value = 1
		End Select
	End Sub
End Class



PLease Help

Is This A Good Question/Topic? -1
  • +

Replies To: Vb6 to vb.net Upgrade Problems! Please Help.

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1606
  • View blog
  • Posts: 5,163
  • Joined: 25-September 09

Re: Vb6 to vb.net Upgrade Problems! Please Help.

Posted 02 February 2010 - 09:02 AM

Did you by any chance Ctrl+Click on the help associated with each warning?

They basically show a vb6 example and the VB.Net solution

As far as the warning on the Lower Bound. It is telling you that indexes no longer start at 1 in vb.net but instead start at 0 for the listview object.

So you will need to change your column numbers to one less than you currently have. (ie, 1 to 0, 2 to 1, etc...)
Was This Post Helpful? 1
  • +
  • -

#3 Pertoh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 31-August 09

Re: Vb6 to vb.net Upgrade Problems! Please Help.

Posted 04 February 2010 - 04:31 AM

View PostCharlieMay, on 02 February 2010 - 08:02 AM, said:

Did you by any chance Ctrl+Click on the help associated with each warning?

They basically show a vb6 example and the VB.Net solution

As far as the warning on the Lower Bound. It is telling you that indexes no longer start at 1 in vb.net but instead start at 0 for the listview object.

So you will need to change your column numbers to one less than you currently have. (ie, 1 to 0, 2 to 1, etc...)


I have Browsed Microsoft trying to resolve that error but to no abounds.. Let me Paste the VB6 Code for Comparison
Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
Dim lvSubscribers As New lvClass
Dim lvReports As New lvClass
Dim lvBills As New lvClass
Dim lvPayments As New lvClass
Dim mbMoving As Boolean
Const sglSplitLimit = 500

Private Sub Form_Load()
openDB
Me.Top = 0
Me.Left = 0
Me.Width = Screen.Width - 60
Call tvConfig
End Sub

Private Sub Form_Paint()
    lvListView.View = Val(GetSetting(App.Title, "Settings", "ViewMode", "0"))
End Sub

Private Sub Form_Resize()
    On Error Resume Next
    If Me.Width < 3000 Then Me.Width = 3000
    SizeControls imgSplitter.Left
End Sub

Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
    With imgSplitter
        picSplitter.Move .Left, .Top, .Width \ 2, .Height - 20
    End With
    picSplitter.Visible = True
    mbMoving = True
End Sub

Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
    Dim sglPos As Single
    

    If mbMoving Then
        sglPos = x + imgSplitter.Left
        If sglPos < sglSplitLimit Then
            picSplitter.Left = sglSplitLimit
        ElseIf sglPos > Me.Width - sglSplitLimit Then
            picSplitter.Left = Me.Width - sglSplitLimit
        Else
            picSplitter.Left = sglPos
        End If
    End If
End Sub

Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
    SizeControls picSplitter.Left
    picSplitter.Visible = False
    mbMoving = False
End Sub

Private Sub TreeView1_DragDrop(Source As Control, x As Single, Y As Single)
    If Source = imgSplitter Then
        SizeControls x
    End If
End Sub

Private Sub SizeControls(x As Single)
    On Error Resume Next
    
    If x < 3500 Then x = 3500
    If x > (Me.Width - 3500) Then x = Me.Width - 3500
    tvTreeView.Width = x
    imgSplitter.Left = x
    lvListView.Left = x + 40
    lvListView.Width = Me.Width - (tvTreeView.Width + 60)
    picTitles.Left = lvListView.Left + 12
    tvTreeView.Top = Me.Top
    lvListView.Top = picTitles.Height
    picTitles.Width = lvListView.Width - 32
    picTitles.Top = Me.Top + 12
    tvTreeView.Height = Me.ScaleHeight
    lvListView.Height = tvTreeView.Height - picTitles.Height - pb1.Height
    imgSplitter.Top = tvTreeView.Top
    imgSplitter.Height = tvTreeView.Height
    pb1.Left = lvListView.Left + 13
    pb1.Width = lvListView.Width
    pb1.Top = tvTreeView.Height - pb1.Height
End Sub

Private Sub tvConfig()
Dim tv1 As Node
Set tv1 = tvTreeView.Nodes.add(, , "explorer", "Program Explorer", 3, 4)
tv1.Tag = "explorer"
tv1.Expanded = True
Set tv1 = tvTreeView.Nodes.add("explorer", tvwChild, "accounts", "Accounts", 1, 2)
tv1.Tag = "accounts"
Set tv1 = tvTreeView.Nodes.add("accounts", tvwChild, "a1", "Subscribers", 5, 6)
tv1.Tag = "a1"
tv1.Expanded = True
Set tv1 = tvTreeView.Nodes.add("accounts", tvwChild, "newaccount", "New Account", 5, 6)
tv1.Tag = "newaccount"
tv1.Expanded = True
'---------------------------------
Set tv1 = tvTreeView.Nodes.add("explorer", tvwChild, "billing", "Bills", 1, 2)
tv1.Tag = "billing"
Set tv1 = tvTreeView.Nodes.add("billing", tvwChild, "b1", "List of Bills", 5, 6)
tv1.Tag = "b1"
tv1.Expanded = True
Set tv1 = tvTreeView.Nodes.add("billing", tvwChild, "p1", "List of Payments", 5, 6)
tv1.Tag = "p1"
tv1.Expanded = True
Set tv1 = tvTreeView.Nodes.add("billing", tvwChild, "bills", "Billing Form", 5, 6)
tv1.Tag = "bills"
tv1.Expanded = True
Set tv1 = tvTreeView.Nodes.add("billing", tvwChild, "pay", "Payment Form", 5, 6)
tv1.Tag = "pay"
tv1.Expanded = True
'---------------------------------
Set tv1 = tvTreeView.Nodes.add("explorer", tvwChild, "prints", "Prints", 1, 2)
tv1.Tag = "prints"
Set tv1 = tvTreeView.Nodes.add("prints", tvwChild, "receipt", "Receipt", 5, 6)
tv1.Tag = "receipt"
tv1.Expanded = True
Set tv1 = tvTreeView.Nodes.add("prints", tvwChild, "individual", "Individual Record", 5, 6)
tv1.Tag = "individual"
tv1.Expanded = True
Set tv1 = tvTreeView.Nodes.add("prints", tvwChild, "all", "All Record", 5, 6)
tv1.Tag = "all"
tv1.Expanded = True
'---------------------------------
Set tv1 = tvTreeView.Nodes.add("explorer", tvwChild, "tool", "Tools", 1, 2)
tv1.Tag = "tool"
Set tv1 = tvTreeView.Nodes.add("tool", tvwChild, "t1", "Users' List", 5, 6)
tv1.Tag = "t1"
tv1.Expanded = True
Set tv1 = tvTreeView.Nodes.add("tool", tvwChild, "useroption", "User Option", 5, 6)
tv1.Tag = "useroption"
tv1.Expanded = True
tv1.Expanded = True
Set tv1 = tvTreeView.Nodes.add("tool", tvwChild, "header", "Header Option", 5, 6)
tv1.Tag = "header"
tv1.Expanded = True
'---------------------------------
Set tv1 = tvTreeView.Nodes.add("explorer", tvwChild, "viewer", "View", 1, 2)
tv1.Tag = "viewer"
Set tv1 = tvTreeView.Nodes.add("viewer", tvwChild, "viewindividual", "Individual Record", 5, 6)
tv1.Tag = "viewindividual"
tv1.Expanded = True
Set tv1 = tvTreeView.Nodes.add("viewer", tvwChild, "viewall", "View All Records", 5, 6)
tv1.Tag = "viewall"
tv1.Expanded = True
'---------------------------------
Set tv1 = tvTreeView.Nodes.add("explorer", tvwChild, "help", "Help", 1, 2)
tv1.Tag = "help"
Set tv1 = tvTreeView.Nodes.add("help", tvwChild, "about", "About the System", 5, 6)
tv1.Tag = "about"
tv1.Expanded = True
End Sub

Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
Select Case Node.Key
 Case "explorer", "accounts", "billing", "tool", "prints", _
 "viewer", "help"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
 Case "newaccount"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
  frmNewAccounts.Show
 Case "bills"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
  frmBillingForm.Show
 Case "pay"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
  frmPayment.Show
 Case "receipt"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
  frmPrint.Show
 Case "individual"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
  frmPrint2.Show
 Case "all"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
On Error GoTo Err
DataEnvironment1.rsCommand1.Source = "SELECT TBilling.AccountNumber, TAccount.FullName, TAccount.Address, TAccount.Brand, TAccount.MeterNumber, TAccount.TypeOfConnection, TBilling.CubicMeterUsed, TBilling.Date, TBilling.Others, TBilling.PaymentWithDeduction, TBilling.Penalty, TBilling.PresReading, TBilling.PrevReading FROM TBilling, TAccount, Login WHERE TBilling.AccountNumber = TAccount.AccountNumber"
DataEnvironment1.rsCommand1.Open
rptReport.Show
Exit Sub
Err:
DataEnvironment1.rsCommand1.Close
DataEnvironment1.rsCommand1.Source = "SELECT TBilling.AccountNumber, TAccount.FullName, TAccount.Address, TAccount.Brand, TAccount.MeterNumber, TAccount.TypeOfConnection, TBilling.CubicMeterUsed, TBilling.Date, TBilling.Others, TBilling.PaymentWithDeduction, TBilling.Penalty, TBilling.PresReading, TBilling.PrevReading FROM TBilling, TAccount, Login WHERE TBilling.AccountNumber = TAccount.AccountNumber"
 Case "useroption"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
  frmUserOption.Show
 Case "header"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
  frmHeader.Show
 Case "viewall"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
  frmViewAll.Show
 Case "viewindividual"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
  frmViewAccounts.Show
 Case "about"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwIcon
  lvListView.ListItems.Clear
  frmAbout.Show
 Case "a1"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwReport
  lvListView.FullRowSelect = True
  lvListView.LabelEdit = lvwManual
  lvListView.Sorted = True
  Set z = lvListView.ColumnHeaders.add(1, , "Account Number")
  Set z = lvListView.ColumnHeaders.add(2, , "Lastname", 2000)
  Set z = lvListView.ColumnHeaders.add(3, , "Firstname")
  Set z = lvListView.ColumnHeaders.add(4, , "MI", 1000)
  Set z = lvListView.ColumnHeaders.add(5, , "Address", 2500)
  Set z = lvListView.ColumnHeaders.add(6, , "Brand")
  Set z = lvListView.ColumnHeaders.add(7, , "Meter Number")
  Set z = lvListView.ColumnHeaders.add(8, , "Type of Connection", 1800)
  lvSubscribers.lvAddSubscribers lvListView, pb1
    pb1.Value = 1
 Case "b1"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwReport
  lvListView.FullRowSelect = True
  lvListView.LabelEdit = lvwManual
  lvListView.Sorted = True
  Set z = lvListView.ColumnHeaders.add(1, , "Account Number")
  Set z = lvListView.ColumnHeaders.add(2, , "Name", 2500)
  Set z = lvListView.ColumnHeaders.add(3, , "Address", 2500)
  Set z = lvListView.ColumnHeaders.add(4, , "Brand")
  Set z = lvListView.ColumnHeaders.add(5, , "Meter Number")
  Set z = lvListView.ColumnHeaders.add(6, , "Type of Connection", 1800)
  Set z = lvListView.ColumnHeaders.add(7, , "Date", 2000)
  Set z = lvListView.ColumnHeaders.add(8, , "Present Reading")
  Set z = lvListView.ColumnHeaders.add(9, , "Previous Reading")
  Set z = lvListView.ColumnHeaders.add(10, , "CuM Used")
  Set z = lvListView.ColumnHeaders.add(11, , "Penalty")
  Set z = lvListView.ColumnHeaders.add(12, , "Others")
  Set z = lvListView.ColumnHeaders.add(13, , "Total Payment")
  Set z = lvListView.ColumnHeaders.add(14, , "Status")
  lvBills.lvAddBills lvListView, pb1
  pb1.Value = 1
 Case "t1"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwReport
  lvListView.FullRowSelect = True
  lvListView.LabelEdit = lvwManual
  lvListView.Sorted = True
  Set z = lvListView.ColumnHeaders.add(1, , "Username", 3000)
  Set z = lvListView.ColumnHeaders.add(2, , "Password", 3000)
  lvReports.lvAddReports lvListView, pb1
   pb1.Value = 1
  Case "p1"
  lvListView.ColumnHeaders.Clear
  lvListView.View = lvwReport
  lvListView.FullRowSelect = True
  lvListView.LabelEdit = lvwManual
  lvListView.Sorted = True
  Set z = lvListView.ColumnHeaders.add(1, , "Account Number")
  Set z = lvListView.ColumnHeaders.add(2, , "Name", 2500)
  Set z = lvListView.ColumnHeaders.add(3, , "Date", 2000)
  Set z = lvListView.ColumnHeaders.add(4, , "Penalty")
  Set z = lvListView.ColumnHeaders.add(5, , "Others")
  Set z = lvListView.ColumnHeaders.add(6, , "Balance")
  Set z = lvListView.ColumnHeaders.add(7, , "Amount", 1800)
  Set z = lvListView.ColumnHeaders.add(8, , "Cash Amount", 1800)
  Set z = lvListView.ColumnHeaders.add(9, , "Payment Type")
  lvPayments.lvAddPayments lvListView, pb1
   pb1.Value = 1
End Select
End Sub



Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2270
  • View blog
  • Posts: 9,496
  • Joined: 29-May 08

Re: Vb6 to vb.net Upgrade Problems! Please Help.

Posted 04 February 2010 - 04:41 AM

If you are upgrading a vb6 project to vb.net instead of relying on the automatic upgrade.
It does its best, but in my opinion it rubbish and rather lazy.
Instead recreate the project from the ground up and utilize a more .net approach.
Was This Post Helpful? 0
  • +
  • -

#5 Pertoh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 31-August 09

Re: Vb6 to vb.net Upgrade Problems! Please Help.

Posted 04 February 2010 - 05:10 AM

View PostAdamSpeight2008, on 04 February 2010 - 03:41 AM, said:

If you are upgrading a vb6 project to vb.net instead of relying on the automatic upgrade.
It does its best, but in my opinion it rubbish and rather lazy.
Instead recreate the project from the ground up and utilize a more .net approach.


I have been trtyind and am not getting anywhere.. its Just That 1 error that produces 35 new errors.
Was This Post Helpful? 0
  • +
  • -

#6 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1606
  • View blog
  • Posts: 5,163
  • Joined: 25-September 09

Re: Vb6 to vb.net Upgrade Problems! Please Help.

Posted 04 February 2010 - 06:13 AM

OK, here is what the help says on the subject:

Quote

In Visual Basic 6.0, the Add method of the ListView control's ColumnHeaders collection requires a ColumnHeader object; the new ColumnHeader is assigned to that object.

In Visual Basic 2008, the Insert method of the ListView ColumnHeaderCollection collection is used to add columns to a ListView control, and the ColumnHeader object is no longer required.

What to do next
Remove the declaration for the ColumnHeader object and change the function to a method.

Copy Code
' Visual Basic 6.0
Dim aColumn As ColumnHeader
Set aColumn = ListView1.ColumnHeaders.Add(1, "key1")

' After upgrade to Visual Basic 2008
Dim aColumn As System.Windows.Forms.ColumnHeader
' UPGRADE_WARNING: Insert method was not upgraded
myColumn = ListView1.Columns.Insert(1, "key1", "", -2)

' Modified code
ListView1.Columns.Insert(0, "key1", "", -2)

Note:
The index parameter was also changed from 1 to 0, because the ListView ColumnHeaderCollection collection is zero-based and
the ColumnHeaders collection is one-based.


Look at the modified code section. This is the VB.Net version of the VB6 code. Notice there is no longer a
myColumn=. This is part of the Add Method does not produce a value warning.
Notice the 1 is a 0 which concerns the warning for the lower bound problem.

As far as AdamSpeight's suggestion. You will probably discover it is the best solution. However, that being said, You may need to get this up and running quickly and this might be the quickest alternative you have at the moment. But, once you do, I suggest you break your code down into segments and begin converting it from the ground up using .net

Take a form, design it in .net and then begin coding that form to produce the same results as your vb converted form.

This post has been edited by CharlieMay: 04 February 2010 - 06:28 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1