ISSUE #2074

    <class1> property <class1>.<prop1> was upgraded to <class1>.<prop2> which has a new behavior

    Description

    During the upgrade process, some class members and events can be mapped to a .NET equivalent with minor behavior differences. If this EWI is displayed in a given project, the selected source structure will not threaten the functional equivalence of the resulting code but can require some manual fine tuning.

    Recommendations

    Compare the new .Net members and events to the old ones and verify their behavioral equivalence. MSDN contains some lists as well as documentation on these equivalences:

    Windows Forms Controls for Visual Basic 6.0 Users

    Sample VB6

    PublicSub NewBehaviorParent(ByVal c As Control)

    Dim b As Form

    b = c.Parent

    MsgBox(c.name & "'s parent is " & b.name)

    EndSub

    Target VB.NET

    PublicSub NewBehaviorParent(ByRef c As Button)

    'UPGRADE_WARNING: (2074) Control property c.Parent was upgraded to c.FindForm which has a new behavior.

    Dim b As Form = c.FindForm()

    MessageBox.Show(c.Name & "'s parent is " & b.Name, Application.ProductName)

    EndSub

    Expected VB.NET

    In this instance, the FindForm() method used by the VBUC behaves equivalently to the Parent property in the original VB6 code.

    PublicSub NewBehaviorParent(ByRef c As Button)

    Dim b As Form = c.FindForm()

    MessageBox.Show(c.Name & "'s parent is " & b.Name, Application.ProductName)

    EndSub

    Target C#

    staticpublicvoid NewBehaviorParent( Button c)

    {

    //UPGRADE_WARNING: (2074) Control property c.Parent was upgraded to c.FindForm which has a new behavior.

    Form b = c.FindForm();

    MessageBox.Show(c.Name + "'s parent is " + b.Name, Application.ProductName);

    }

    Expected C#

    In this instance, the FindForm() method used by the VBUC behaves equivalently to the Parent property in the original VB6 code.

    staticpublicvoid NewBehaviorParent( Button c)

    {

    Form b = c.FindForm();

    MessageBox.Show(c.Name + "'s parent is " + b.Name, Application.ProductName);

    }


    Download VBUC Free Trial
    Download VBUC Now

    It's time to eradicate VB6
    ROI of eradicating VB6

    8 Proven Tips for
    Planning a Successful Migration

    8 Tips for migration