- INDEX VB TO NET
- KNOWLEDGE BASE
- EWIS-ISSUES
- ISSUE #2074
WARNING #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
Public Sub NewBehaviorParent(ByVal c As Control) Dim b As Form Set b = c.Parent MsgBox c.Name & "'s parent is " & b.Name End Sub
Target VB.NET
Public Sub NewBehaviorParent(ByVal c As Label) '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, My.Application.Info.Title) End Sub
Target C#
public void NewBehaviorParent(Label 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, AssemblyHelper.GetTitle(System.Reflection.Assembly.GetExecutingAssembly())); }