VB.NET doesn't support control array, therefore both the Upgrade Wizard and VB Migration Partner generate one standard control whose name is obtained by appending the index to the control array name.

For example, if you have a control array named txtFields, then the txtFields(0) element  is converted into a control named txtFields_000, the txtFields(1) element is converted into a control named txtFields_001, and so forth. However, when the control is referenced in code, the VB6-like syntax is preserved. In our example, the generated code might contain elements like txtFields(0).ForeColor rather than txtFields_001.ForeColor. This is intentional, because it's the only way to create a control reference when the index is an expressoion rather than a constant.

One of our customers, however, asked whether it would be possible to generate code that references the actual .NET control whenever possibile (in other words, txtFields_000.ForeColor rather than txtFields(0).ForeColor). Personally I think that these references might be disorienting and prefer the kind of code that VB Migration Partner generates. At any rate, the answer is yes, VB Migration Partner allows you to tweak the generated code by means of the PostProcess pragma. This is how to achieve the desired effect:

'## PostProcess "txtFields\((?<index>\d)\)", "txtFields_00${index}"
'## PostProcess "txtFields\((?<index>\d\d)\)", "txtFields_0${index}"

where the second pragma is only necessary if the txtFields control array contains elements whose index is 10 or higher. These pragmas should be placed at the top of the form where the control array resides and have no effect if the control is accessed from another form.

If the form contains two or more control arrays, you still need only two pragmas. For example, if the form contains three control arrays named txtFields, lblFields, and chkOptions, you can fix control references with constant indexes using these pragmas:

'## PostProcess "(?<arr>txtFields|lblFields|chkOptions)\((?<index>\d)\)", "${arr}_00${index}"
'## PostProcess "(?<arr>txtFields|lblFields|chkOptions)\((?<index>\d\d)\)", "${arr}_0${index}"