Hi friends,
I am migrating VB6 project to VB.Net. I am stuck with these warnings for which I am unable to find solutions. I would be grateful if I get solutions to atleast some of the below warnings.
Warnings:
-------------
Need VB.Net equivalent for the below code as they are obsolete and have the same warning sign(***):
"Warning: 'Microsoft.VisualBasic.Compatibility.VB6.***' is obsolete: 'Microsoft.VisualBasic.Compatibility.* classes are obsolete."

-> VB6.ToPixelsUserX
Eg. pctSupport.Left = VB6.ToPixelsUserX(732, 0, 5451.19, 387)

-> VB6.ToPixelsUserY
Eg. pctSupport.Top = VB6.ToPixelsUserY(869, 0, 3209.51, 310)

-> VB6.ToPixelsUserHeight
Eg. pctSupport.Height = VB6.ToPixelsUserHeight(2205, 3209.51, 310)

-> VB6.ToPixelsUserWidth
Eg. pctSupport.Width = VB6.ToPixelsUserWidth(4465, 5451.19, 387)

-> VB6.GetItemData
Eg. HookupPipeRecord = VB6.GetItemData(lstPipe, lstPipe.SelectedIndex)

-> VB6.MouseButtonConstants
Eg. Button = VB6.MouseButtonConstants.RightButton

-> VB6.ListBoxItem
Eg. lstcategory.Items.Add(New VB6.ListBoxItem(Trim(category.Name), categoryRecord(N)))

-> VB6.DriveListBox
Eg. Public WithEvents Drive1 As New Microsoft.VisualBasic.Compatibility.VB6.DriveListBox

-> VB6.DirListBox
Eg. Public WithEvents Dir1 As New Microsoft.VisualBasic.Compatibility.VB6.DirListBox

-> VB6.FileListBox
Eg. Public WithEvents File1 As Microsoft.VisualBasic.Compatibility.VB6.FileListBox

-> BaseControlArray
Eg. <ProvideProperty("Index", GetType(LineShape))> Friend Class LineShapeArray
Inherits BaseControlArray
Implements IExtenderProvider

Errors:
-------------
-> Error: 'PrintForm1' is not a member of 'System.Windows.Forms.Form'.
.PrintForm1.Print(frm, PowerPacks.Printing.PrintForm.PrintOption.CompatibleModeClientAreaOnly)

-> Error: 'Me' is not valid within a Module.
"where 'Module GenSubs' is a class & not form."
Eg. Dim g As Graphics = Me.CreateGraphics()

Regards,
Simran Kaur.

Re: VB.Net equivalent of VB6 code which are obsolete. 80 80

What doing the conversion? Visual Studio?

Try Artinsoft Visual Basic Upgrade Companion.

They have a free 1 month/ 10,000 lines of code limit. But it could get you further along.

commented: was helpful +1
Re: VB.Net equivalent of VB6 code which are obsolete. 80 80

Hello,
Was busy finding number of lines in my project. Thanks for ur suggestion. Got answer to most of the above errors in the Microsoft Forum website.
http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/b2d13c9a-e320-4f36-981e-e4c1999d7694/
Regards,
Simran Kaur.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.