ActiveX Controls Are Still Supported--Yes

ActiveX Controls Are Still Supported Yes!

One difference between the transition from Visual Basic 6 to .NET and that from Visual Basic 3 to 4 is that Visual Basic .NET still supports the old component model. This was not true of Visual Basic 4. Migrating your VBX components to ActiveX was an all-or-nothing proposition. If you wanted to continue to use VBXs, you had to keep your application in the 16-bit world. If the vendor for your favorite control did not have a 32-bit ActiveX control replacement for your favorite VBX control, you were out of luck. You had to either wait it out and hope the vendor released a compatible control or use an ActiveX component provided by a different vendor. In any case, you were likely to run into issues when upgrading your application, whether the ActiveX component claimed full compatibility or not.

In Visual Basic .NET, you have the choice of using either an ActiveX component or an equivalent .NET component in its place. Unlike Visual Basic 4, which had a control migration feature that automatically upgraded your VBX controls to ActiveX controls, Visual Basic .NET has no such feature. Furthermore, Microsoft is not introducing any of the new .NET controls and components as direct replacements of similarly featured ActiveX controls. For example, even though there is a .NET TreeView control, it is not fully compatible with the ActiveX TreeView control. In most cases, you will need to make modifications to your code to use the new .NET controls. We ll discuss how to replace ActiveX controls with Windows Forms controls in Chapter 19. For now, let s concentrate on using ActiveX controls in Visual Basic .NET.

ActiveX Upgrade Strategy

Since one of the overriding goals of the Upgrade Wizard is to ensure compatible behavior after you upgrade your application to Visual Basic .NET, the Visual Basic team decided to allow your project to use the same ActiveX controls and components as before. There are a couple of exceptions to this rule, but in general your Visual Basic .NET application will run against the same set of ActiveX components after the upgrade. This strategy greatly increases the chances that your application will perform exactly as it did in Visual Basic 6. Once you are assured that everything is behaving the way you expect it to, you can replace ActiveX controls and components with equivalent .NET components as you see fit.



Upgrading Microsoft Visual Basic 6.0to Microsoft Visual Basic  .NET
Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET w/accompanying CD-ROM
ISBN: 073561587X
EAN: 2147483647
Year: 2001
Pages: 179

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net