VB to .NET

ISSUE #2029

Unload 1% was not upgraded.

Description 

This issue was fixed automatically in the VB6 AI Migrator version 2.2 using GAPVelocity AI helper classes.

Sample VB6 

Dim i As Integer
    If Label1.Count <> 1 Then
   'Unload labels by their indexes
   For i = 1 To Label1.Count - 1
       Unload Label1(i)
   Next
End If 

Target VB.NET 

If Label1.Length <> 1 Then
'Unload labels by their indexes
For i AsInteger = 1 To Label1.Length - 1
ContainerHelper.UnloadControl(Me, "Label1", i)
Next
EndIf 

Expected VB.NET 

If Label1.Length <> 1 Then
'Unload labels by their indexes
For i AsInteger = 1 To Label1.Length - 1
ContainerHelper.UnloadControl(Me, "Label1", i)
Next
EndIf 

Target C# 

if (Label1.Length != 1)
{
//Unload labels by their indexes
for (int i = 1; i <= Label1.Length - 1; i++)
{
ContainerHelper.UnloadControl(this, "Label1", i);
}
} 

Expected C# 

if (Label1.Length != 1)
{
//Unload labels by their indexes
for (int i = 1; i <= Label1.Length - 1; i++)
{
ContainerHelper.UnloadControl(this, "Label1", i);
}
}

Talk To An Engineer