BYTEINSIGHT
GAPVelocity AI Studio helps you move from outdated tech stacks to the latest desktop, web, and cloud platforms—smarter, faster, and with less risk.
Choose a platform to see migration options:
Our comprehensive approach to application modernization, from assessment to production deployment.
Transformation Services
Not Sure Where to Start?
Using the VBUC, ActiveX controls can be migrated to .NETWindows Controls. This can present a problem when migrating certain ActiveX User Controls that implement Events that are no longer supported in .NET. In most cases, this is because they do not have an exact equivalent in .NET.
An understanding of both the source platform and the target platform is helpful in coming up with a viable solution. Some of this is described in MSDN's User Controls for Visual Basic 6.0 Users.
Visual Basic 6.0 Support
Resources for those unfamiliar with Visual Basic 6.0 ActiveX Controls:
.Net Framework Support
Private Sub UserControl_WriteProperties(PropBag As PropertyBag) Debug.Print "WriteProperties" PropBag.WriteProperty "Caption", Caption, Extender.Name End Sub
'UPGRADE_ISSUE: (2068) PropertyBag object was not upgraded. 'UPGRADE_WARNING: (6002) UserControl Event WriteProperties is not supported. Private Sub UserControl_WriteProperties(ByVal PropBag As UpgradeSolution1Support.UpgradeStubs.PropertyBag) Debug.WriteLine("WriteProperties") 'UPGRADE_ISSUE: (2064) UserControl property UserControl1.Extender was not upgraded. 'UPGRADE_ISSUE: (2064) PropertyBag method PropBag.WriteProperty was not upgraded. PropBag.WriteProperty("Caption", Text, Me.getExtender().Name) End Sub
//UPGRADE_ISSUE: (2068) PropertyBag object was not upgraded. //UPGRADE_WARNING: (6002) UserControl Event WriteProperties is not supported. private void UserControl_WriteProperties(UpgradeStubs.PropertyBag PropBag) { Debug.WriteLine("WriteProperties"); //UPGRADE_ISSUE: (2064) UserControl property UserControl1.Extender was not upgraded. //UPGRADE_ISSUE: (2064) PropertyBag method PropBag.WriteProperty was not upgraded. PropBag.WriteProperty("Caption", Convert.ToString(Caption), this.getExtender().Name); }
This solution makes use of Application Settings to replace Visual Basic 6's PropertyBag. In most cases this is not necessary as .NET's design model maintains the state of properties without the use of the Settings object. This example assumes that these values need to be preserved between instances of the program.
private void UserControl_WriteProperties() { Debug.WriteLine("WriteProperties"); Properties.Settings.Default.Caption = this.Name; }