StatusBar.Panels(1)
returns a MSComctlLib.Panel
.
StatusBar.Panels(1) = "Initializing Folders..."
is valid in VB6 because of default properties.
Default properties in VB.NET must have parameters. A parameterless property cannot be default and therefore cannot be omitted. Thus, .Panels(1) = "..."
is understood by VB.NET as an attempt to replace the entire Panel
in the Panels
property, which is not allowed.
You can look up the name of the default property in the VB6 object browser, which turns out to be Property _ObjectDefault As String
, so you should be able to do:
CObj(prvMainForm).StatusBar.Panels(1).[_ObjectDefault] = "Initializing Folders..."
As you have observed, assigning Text
should do the same:
CObj(prvMainForm).StatusBar.Panels(1).Text = "Initializing Folders..."