Status Bar Updates

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Hi,

I have developed an MDI program, and simply wish to update
a text panel on a status bar situated on the MDI from from
a child form. In VB6 this was as easy as pie!

How do you achieve it in Vb.net?

I've tried a public property, referencing
me.mdi.parent.controls etc etc and nothing seems to work.

Any Ideas?

Dave
 
Dave said:
I have developed an MDI program, and simply wish to update
a text panel on a status bar situated on the MDI from from
a child form. In VB6 this was as easy as pie!

How do you achieve it in Vb.net?

I've tried a public property, referencing
me.mdi.parent.controls etc etc and nothing seems to work.

Any Ideas?

At compile time, VB does not know which Form will be the MDI parent,
therefore you have to use type-casting:

Directcast(Me.mdiparent, <typeOfMdiParent>).Statusbar.text = "text"

Replace "<typeOfMdiParent>" by the class name of the MDI parent.
 
* "Dave said:
I have developed an MDI program, and simply wish to update
a text panel on a status bar situated on the MDI from from
a child form. In VB6 this was as easy as pie!

How do you achieve it in Vb.net?

I've tried a public property, referencing
me.mdi.parent.controls etc etc and nothing seems to work.

Code for the MDI child (let 'MainForm' be the type of the MDI
container):

\\\
DirectCast(Me.MdiParent, MainForm).StatusBar1.Text = ...
///
 
Back
Top