About loading Windows forms has different behavior
The following are example VB .NET errors:
- Error 1 Name 'Load' is not declared.
- Error 2 'frmAlgorithmicColorRamp' is a type and cannot be used as an expression.
- Error 3 Reference to a non-shared member requires an object reference.
- Error 4 Reference to a non-shared member requires an object reference.
The following is the cause of the VB .NET error:
- In VB6, the Load statement can be used to load a form without displaying it. You can also load a form without displaying it by referencing any of its properties. The Load statement is no longer supported in VB .NET. When an instance of a form is created by using the New keyword, it is not loaded until the Show method is called.
The following is the original VB6 code:
Load frmAlgorithmicColorRamp frmAlgorithmicColorRamp.m_lngClasses = pCBRend.BreakCount frmAlgorithmicColorRamp.Show vbModal
The following shows the initial auto-translated code and the correct VB .NET translation code:
[VB.NET]
'Initial auto-translated VB .NET conversion.
Load(frmAlgorithmicColorRamp)
frmAlgorithmicColorRamp.m_lngClasses = pCBRend.BreakCount
frmAlgorithmicColorRamp.ShowDialog()
[VB.NET]
'Correct VB .NET translation.
Dim frmAlgorithmicColorRamp As New frmAlgorithmicColorRamp
frmAlgorithmicColorRamp.m_lngClasses = pCBRend.BreakCount
frmAlgorithmicColorRamp.ShowDialog()
See Also:
Migrating from VB6 to VB.NETGeneral steps for migrating from VB6 to VB.NET
Development licensing | Deployment licensing |
---|---|
ArcGIS for Desktop Basic | ArcGIS for Desktop Basic |
ArcGIS for Desktop Standard | ArcGIS for Desktop Standard |
ArcGIS for Desktop Advanced | ArcGIS for Desktop Advanced |
Engine Developer Kit | Engine |