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.

Recommended Answers

All 2 Replies

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
Be a part of the DaniWeb community

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