Microsoft
This section includes options to upgrade the common controls created by Microsoft and shipped with Visual Basic 6.0.
All these options have two choices: to upgrade using COM Interop and to upgrade using .NET native components. In general, it is recommended to use the .NET native components, although in some cases there might be some manual changes required to achieve functional equivalence.
1. MSACAL
Microsoft Calendar Control control.
1.1. To System.Windows.Forms.MonthCalendar
Convert MSACAL.Calendar to a .NET equivalent control.
Class
Maps to
MSACAL.Calendar
System.Windows.Forms.MonthCalendar
Original VB6 code:
Begin VB.Form Form1
...
Begin MSACAL.Calendar Calendar1
Height = 2895
Left = 120
TabIndex = 0
Top = 120
Width = 4335
...
End
EndC# code:
VB.NET code:
1.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
C# code:
VB.NET code:
2. MSComCt2
Microsoft Windows Common Controls 2 library.
2.1. To native .NET component (System.Windows.Forms)
Convert Microsoft's MSComCtl2 classes to System.Windows.Forms.
The following list shows which MSComCtl2 controls are mapped to .NET equivalents:
Class
Maps to
MSComCtl2.DTPicker
System.Windows.Forms.DateTimePicker
MSComCtl2.MonthView
System.Windows.Forms.MonthCalendar
MSComCtl2.FormatConstants
System.Windows.Forms.DateTimePickerFormat
MSComCtl2.MonthViewHitTestAreas
System.Windows.Forms.MonthCalendar.HitArea
MSComCtl2.DayConstants
System.Windows.Forms.Day
Original VB6 code:
C# code:
VB.NET code:
2.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
C# code:
VB.NET code:
3. MSComCtl
Microsoft Windows Common Controls Library
3.1. To native .NET component (System.Windows.Forms)
Convert Microsoft's MSComctlLib classes to System.Windows.Forms.
Class
Maps to
MSComctlLib.StatusBar
System.Windows.Forms.StatusStrip
MSComctlLib.ToolBar
System.Windows.Forms.ToolStrip
MSComctlLib.ImageList
System.Windows.Forms.ImageList
MSComctlLib.TabStrip
System.Windows.Forms.TabControl
MSComctlLib.TreeView
System.Windows.Forms.TreeView
MSComctlLib.ImageCombo
System.Windows.Forms.ComboBox
MSComctlLib.ListView
System.Windows.Forms.ListView
MSComctlLib.ProgressBar
System.Windows.Forms.ProgressBar
Original VB6 code:
C# code:
VB.NET code:
3.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
C# code:
VB.NET code:
4. MSComDlg
Microsoft Common Dialog Control Library
4.1. To native .NET component (System.Windows.Forms)
The MSComDlg CommonDialog control is used to display several types of dialogs: open file, save file, printer, color, and font dialogs. In .NET there are different types of dialog controls according to the necessity.
The VB6 AI Migrator converts the CommonDialog according to its use in the Visual Basic 6.0 source code to the following alternative controls: ColorDialog, FontDialog, OpenDialog, SaveDialog, and PrintDialog.
Original VB6 code:
C# code:
VB.NET code:
4.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
C# code:
VB.NET code:
5. DataCombo
5.1. To System.Windows.Forms.ComboBox
Convert Microsoft's MSDataList.DataCombo classes to System.Windows.Forms.
Class
Maps to
MSDataListLib.DataCombo.ListField
System.Windows.Forms.DisplayMember
MSDataListLib.DataCombo.BoundColumns
System.Windows.Forms.ValueMember
MSDataListLib.DataCombo.BoundText
System.Windows.Forms.SelectedValue
MSDataListLib.DataCombo.Height
System.Windows.Forms.Height
MSDataListLib.DataCombo.Width
System.Windows.Forms.Width
MSDataListLib.DataCombo.Text
System.Windows.Forms.Text
MSDataListLib.DataCombo.SelectedItem
System.Windows.Forms.SelectedIndex
MSDataListLib.DataCombo.SetFocus
System.Windows.Forms.Focus
Original VB6 code:
C# code:
VB.NET code:
5.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
C# code:
VB.NET code:
6. MSMask
Microsoft Mask Edit Control Library
6.1. To System.Windows.Forms.MaskedTextBox
Convert Microsoft's MSMask classes to System.Windows.Forms.
Class
Maps to
MSMask.MaskedBox
System.Windows.Forms.MaskedTextBox
MSMask.ClipModeConstants
System.Windows.Forms.MaskFormat
MSMask.BorderStyleConstants
System.Windows.Forms.BorderStyle
MSMask.MousePointerConstants
System.Windows.Forms.Cursor
Original VB6 code:
C# code:
VB.NET code:
6.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
C# code:
VB.NET code:
7. MSMQ
Microsoft Message Queue Object Library
7.1. To System.Messaging Library
Convert MSMQ (Microsoft Message Queue Object Library) to System.Messaging .NET library.
MSMQ.MSMQQueueInfo
System.Messaging.MessageQueue
MSMQ.MSMQQueue
System.Messaging.MessageQueue
MSMQ.MSMQMessage
System.Messaging.Message
MSMQ.MSMQQueueInfos
Array of System.Messaging.MessageQueue
MSMQ.MSMQTransactionDispenser
System.Messaging.MessageQueueTransaction
MSMQ.MSMQTransactionDispenser
System.Messaging.MessageQueueTransaction
MSMQ.MSMQCoordinatedTransactionDispenser
System.Messaging.MessageQueueTransaction
Original VB6 Code:
C# Code:
VB.NET Code:
7.2. To COM Interop
This feature will take the legacy COM library and create an interoperability code wrapper to make it visible from the managed code. This means the library functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy library.
Original VB6 Code:
C# Code:
VB.NET Code:
8. MSWLess
Microsoft Windowless Controls Library
8.1. To System.Windows.Forms controls
Convert Microsoft's MSWLess to System.Windows.Forms .NET component controls.
Class
Maps to
MSWLess.WLCheck
System.Windows.Forms.CheckBox
MSWLess.WLCombo
System.Windows.Forms.ComboBox
MSWLess.WLText
System.Windows.Forms.TextBox
MSWLess.AlignmentConstants
System.Drawing.ContentAlignment
MSWLess.CheckValueConstants
System.Windows.Forms.CheckState
MSWLess.StyleComboConstants
System.Windows.Forms.ComboBoxStyle
MSWLess.ScrollBarsConstants
System.Windows.Forms.ScrollBars
Original VB6 code:
C# code:
VB.NET code:
8.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
C# code:
VB.NET code:
9. MSXML2
Microsoft XML2 Library
9.1.To System.Xml classes
Convert Microsoft's MSXML2 library to System.Xml .NET classes.
Class
Maps to
MSXML2.DOMDocument
System.Xml.XmlDocument
MSXML2.DOMNodeType
System.Xml.XmlNodeType
MSXML2.IXMLDOMAttribute
System.Xml.XmlAttribute
MSXML2.IXMLDOMCDATASection
System.Xml.XmlCDataSection
MSXML2.IXMLDOMDocument
System.Xml.XmlDocument
MSXML2.IXMLDOMElement
System.Xml.XmlElement
MSXML2.IXMLDOMNamedNodeMap
System.Xml.XmlNamedNodeMap
MSXML2.IXMLDOMNode
System.Xml.XmlNode
MSXML2.IXMLDOMNodeList
System.Xml.XmlNodeList
MSXML2.IXMLDOMParseError
System.Exception
MSXML2.IXMLDOMText
System.Xml.XmlCharacterData
MSXML2.tagDOMNodeType
System.Xml.XmlNodeType
MSXML2.IXMLDOMCharacterData
System.Xml.XmlCharacterData
MSXML2.IXMLDOMDocumentFragment
System.Xml.XmlDocumentFragment
MSXML2.IXMLDOMComment
System.Xml.XmlComment
MSXML2.IXMLDOMEntity
System.Xml.XmlEntity
MSXML2.IXMLDOMEntityReference
System.Xml.XmlEntityReference
MSXML2.IXMLDOMImplementation
System.Xml.XmlImplementation
MSXML2.IXMLDOMNotation
System.Xml.XmlNotation
MSXML2.IXMLDOMProcessingInstruction
System.Xml.XmlProcessingInstruction
MSXML2.IXMLDOMDocumentType
System.Xml.XmlDocumentType
MSXML2.FreeThreadedDOMDocument
System.Xml.XmlDocument
MSXML2.FreeThreadedDOMDocument40
System.Xml.XmlDocument
MSXML2.DOMDocument40
System.Xml.XmlDocument
Original VB6 code:
C# code:
VB.NET code:
9.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
C# code:
VB.NET code:
10. RichTextBox
10.1. To System.Windows.Forms.RichTextBox
Convert RichTextBox to a .NET component control.
Class
Maps to
RichTextLib.RichTextBox
System.Windows.Forms.RichTextBox
RichTextLib.AppearanceConstants
System.Windows.Forms.BorderStyle
RichTextLib.BorderStyleConstants
System.Windows.Forms.BorderStyle
RichTextLib.ScrollBarsConstants
System.Windows.Forms.RichTextBoxScrollBars
RichTextLib.FindConstants
System.Windows.Forms.RichTextBoxFinds
RichTextLib.LoadSaveConstants
System.Windows.Forms.RichTextBoxStreamType
RichTextLib.SelAlignmentConstants
System.Windows.Forms.HorizontalAlignment
RichTextLib.MousePointerConstants
System.Windows.Forms.Cursor
Original VB6 code:
C# code:
VB.NET code:
10.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
C# code:
VB.NET code:
11. Scripting
11.1. To .NET classes
This feature maps the "Scripting.Dictionary" class to a .NET "OrderedDictionary". A dictionary is an object that stores key/item pairs. Each item is associated with a unique key which is usually an integer or a string. For full information about the vb6 class you can visit: https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/dictionary-object
General Description:
An OrderedDictionary is a dictionary (hash table) that preserves the order (as VB6 does) in which the keys are inserted. A regular dictionary does not track the insertion order.
Original VB6 code:
C# code:
VB.NET code:
11.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
C# code:
VB.NET code:
12. SHDocVw
Microsoft Internet Controls Library
12.1. To System.Windows.Forms.WebBrowser
Convert the controls and classes contained in the shdocvw.dll to .NET Native classes.
General Description:
The Microsoft Internet Controls (SHDocVw) is a set of controls and classes that enable building web/DHTML applications in Visual Basic 6. WebBrowser and InternetExplorer are controls of this library.
Class
Maps to
WebBrowser
System.Windows.Forms.WebBrowser
SecureLockIconConstants
System.Windows.Forms.WebBrowserEncryptionLevel
tagREADYSTATE
System.Windows.Forms.WebBrowserReadyState
InternetExplorer
System.Windows.Forms.WebBrowser
Original VB6 code:
C# code:
VB.NET code:
12.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
C# code:
VB.NET code:
13. Shell32
13.1. To System.Diagnostics Methods
Convert the API calls of Shell32 to their equivalents in System.Diagnostics.
Operation
Purpose
Edit
Launches an editor and opens the file for editing.
Explore
Explores the folder listed in the file parameter.
Find
Starts the find utility at the specified directory.
Open
Opens the file using the appropriate default application. It can also executes processes and applications.
Prints the file.
Original VB6 code:
C# code:
VB.NET code:
13.2. To PInvoke
This option will port the API call into the resulting application via a support project.
General Description:
This optional feature will take the API declaration and create an interoperability code wrapper to make it visible from the managed code. This means the call’s functionality will remain the same since it will use the same API but the resulting application will depend on the API binary file.
Original VB6 code:
C# code:
VB.NET code:
14. VB Script Regex
The VB Script RegExp class compares strings with specific text patterns known as regular expressions.
14.1. To System.Text.RegularExpressions and helpers
This optional feature allows the VB6 AI Migrator to convert VB Script RegExp to System.Text.RegularExpressions library and helpers.
VBScript_RegExp_55.Regexp
UpgradeHelpers.Utils.ScriptRegexHelper
VBScript_RegExp_55.MatchCollection
System.Text.RegularExpressions.MatchCollection
VBScript_RegExp_55.Match
System.Text.RegularExpressions.Match
Original VB6 Code:
C# code:
VB.NET code:
14.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 Code:
C# code:
VB.NET Code:
Last updated
Was this helpful?