第二部分
原文:
VB6 and ActiveX Controls
Most of the basic VB6 controls will be upgraded by the wizard without any issues,as will many advanced and third-party controls. Even complex ActiveX controls like the MSChart and third party controls are likely to convert with only minor changes in Syntax. For instance,the MSChart control converts and mostly behaves like the original. The biggest difference is that the Axis is accessed as a property in VB6,but this is done by using an accessor in VB.NET. For example,in VB6 the XAxis maximum value is set by the statement:
MSChart1.Plot.Axis(VtChAxisIdY,0).ValueScale.Maximum = 370
In VB.NET,it is set by the statement:
MSChart1.Plot.get_Axis(VtChAxisIdY,0).ValueScale.Maximum = 370;
As far as I can tell,this is the only property of MSChart that is treated with this minor difference. The wizard will automatically create a wrapper for any ActiveX controls used in the project. You can also create a wrapper for any ActiveX control you want to use in a .NET program by simply right-clicking on the toolBox,selecting add/remove items,and then choosing the ActiveX control from the COM tab of the Dialog Box. This task can also be accomplished by running the TlbImp.exe utility that comes with the free .NET SDK. One small difference: an "upgraded" ActiveX control is referred to by its original name when referenced in the program,but an ActiveX control added to a new .NET project gets an "ax" prefix. For instance,when upgraded from a VB6 project,MSChart stays MSChart; when added to a .NET project,it becomes axMSChart.
While complex components and ActiveX controls are moved to .NET via the use of wrappers,basic VB6 controls are upgraded to (replaced by) VB.NET controls.