VB to .NET

ISSUE #2042

A string cannot be used to index the 1% control collection.

Description  

VB6 AI Migrator converts the VB6 controls collection to a Helper Class that emulates most of the functionality of the VB6 controls collection; nevertheless this approach does not work in certain scenarios, in which manual chages are required to remove this issue. 

Recommendations 

Use the .NET Controls Collection. 

Sample VB6

Controls.Remove ("Text1")

Target VB.NET 

ContainerHelper.Controls(Me).Remove("Text1")

Expected VB.NET 

Me.Controls.RemoveByKey("Text1") 

Target C# 

ContainerHelper.Controls(this).Remove("Text1"); 

Expected C# 

this.Controls.RemoveByKey("Text1");

Talk To An Engineer