Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the text in statusbar of mdiparent 1

Status
Not open for further replies.

Jacqui1811

Programmer
Jul 8, 2002
100
SG
Hi folks.
I want to set the text in the mdi parent from a child form but have had no luck.
Can anybody give me a push in the right direction :)
Thanks.
Jacqui.
 
What code do you have so far?

Off the top of my head I would think you would do something like this

Code:
ParentFormObject frmParent = (ParentFormObject)this.Parent;
frmParent.StatusBar[0].Text = "My Text"
frmPartent = null;
 
Hi,
Thanks for replying ralphtrent.
I haven't realy any relevant code to paste, however I am accessing the mdi parent to set other things as below.

this.MdiParent.MainMenuStrip.Enabled = true;

I can not seem to get it to offer me the StatusBar option.

Jacqui.
 
With the following code in my child form, I was able to set the status bar text (first item)

Code:
StatusStrip ss = (StatusStrip)this.MdiParent.Controls.Find("statusStrip1", true)[0];
            if (ss.Items.Count == 0)
            {
                ss.Items.Add("TextToChange");
            }
            else
            {
                ss.Items[0].Text = "TextToChange";
            }
            ss = null;
Hope this helps.
 
Thanks,
That got the job done perfectly :).
Regards
Jacqui.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top