Hello everybody,
From my MDI child form, I need to change the text property of statusbar panel of MDI parent.
Thanks
Printable View
Hello everybody,
From my MDI child form, I need to change the text property of statusbar panel of MDI parent.
Thanks
from the MDI child use thisQuote:
Originally Posted by usamaalam
this.MdiParent.YouStatusBarsName....
rate my posts :wave:
I am unable to see status bar in MDIParent property of the child form.
oh my bad! I wasnt thinking rightQuote:
Originally Posted by usamaalam
VB Code:
Dim frmParent As frmMdiParent frmParent = DirectCast(Me.MdiParent, frmMdiParent) frmParent.statusBarHere
MdiParent property returns the form, but it returns it as a general form. You need to convert it to the the type of your main mdi form is called, and you do that by calling DirectCast as you see up there
rate my posts :wave:
ah thought I'm in the vb.net forum. I leave that up for reference :) here's the c# version:
where frmMdiParent is the name of your mdi form, and you put this code in the mdi child form.Code:frmMdiParent frmParent = (frmMdiParent)this.MdiParent;
frmParent.statusBar1.Text="DASFADSF";
One thing I just noted is that apparently in C# controls and things you put on the form are declared as private, so you need to manually change the code that VS.NET generates. In your mdi form, if you search for the name of your statusbar you should see a line like this near the top of the class:
private System.Windows.Forms.StatusBar statusBar1;
you need to change the private to public in order for you to be able to access it through the mdi child
HTH
rate my posts :wave:
Thanks. I made a little conversions for C#. Now this works for me.
Thank you so much, i searched too much for this but not one was able to help me, by chance i visited ur reply and got the solution.....
Good work done...
Thanks