Click here to Skip to main content
13,149,099 members (48,847 online)
Click here to Skip to main content
Add your own
alternative version


23 bookmarked
Posted 30 Nov 2004

Access Parent Statusbar from a child

, 30 Nov 2004
Rate this:
Please Sign up or sign in to vote.
Update the parent's status bar panel(s) from a child MDI form


Like many others I have been searching for a way to access the statusbar on a MDI parent form from a child in the simplest and least code intensive manner.

Again, like most others I have found that this appears to be like the Holy Grail .... someone knows but is not telling.

Well after wasting my time on searches and finding all kinds of advice on reflection, events etc I decided to do some coding - hacking in the old sense.

The following code works quite nicely, but has only been tested on an XP Pro system using VSNet2K3.

Steps to do

Assuming a status bar with 1 panel ....

  • In the child form add the following variable:
    public System.Windows.Forms.StatusBarPanel pfrm_sbp1 = null;
  • Add the following code where you want to update the statusbar PANEL:
    pfrm_sp1.Text = "How did he do that?";
  • In the parent form when you create the child, set the reference:
    Form2 newMDIChild = new Form2();
    newMDIChild.MdiParent = this;
    newMDIChild.pfrm_sp1 = statusBarPanel1;

Of course, you could do this via other more secure mechanisms (please do) - make the reference variable private with get/set functions, perhaps make it an array of panel references, but you get the basic idea now don't you.

Anything more pervasive would benefit from a more comprehensive and better design here's an excellent article (link) to guide you if you decide to go further down into the internals of inter window communications.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Architect Synovus Financial
United States United States
A conforming non-conformist (yes they exist), currently employed as a Technical Analyst and solution architect in the financial sector.

I am addicted to the Atlanta Braves, my two boys and my wife in various orders based on the circumstances and context.

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
ginojmg27-Nov-11 1:16
memberginojmg27-Nov-11 1:16 
GeneralThanks Pin
pintamono29-Dec-08 7:02
memberpintamono29-Dec-08 7:02 
Generalthe simplest way to access the status bar of the mdi parent Pin
Salman Farooq13-Mar-08 2:01
memberSalman Farooq13-Mar-08 2:01 
GeneralRe: the simplest way to access the status bar of the mdi parent Pin
LimeyRedneck15-Mar-08 8:10
memberLimeyRedneck15-Mar-08 8:10 
GeneralRe: the simplest way to access the status bar of the mdi parent Pin
Member 397851720-Mar-08 18:28
memberMember 397851720-Mar-08 18:28 
Questionhow can we set MDI.Parent of relevant form as nothing Pin
mshariq14-Nov-07 1:01
membermshariq14-Nov-07 1:01 
AnswerRe: how can we set MDI.Parent of relevant form as nothing Pin
LimeyRedneck28-Nov-07 13:52
memberLimeyRedneck28-Nov-07 13:52 
GeneralRe: how can we set MDI.Parent of relevant form as nothing Pin
mshariq28-Nov-07 18:54
membermshariq28-Nov-07 18:54 
QuestionWhat to do? Pin
tomek13m14-May-07 2:24
membertomek13m14-May-07 2:24 
AnswerRe: What to do? Pin
LimeyRedneck14-May-07 16:58
memberLimeyRedneck14-May-07 16:58 
GeneralThanks Pin
DrPete23-Apr-07 22:39
memberDrPete23-Apr-07 22:39 
GeneralRe: Thanks Pin
LimeyRedneck24-Apr-07 6:42
memberLimeyRedneck24-Apr-07 6:42 
GeneralSmartly Done Pin
davelalit15-Sep-06 23:37
memberdavelalit15-Sep-06 23:37 
GeneralWell done!!! Pin
Nikola Knezevic17-Aug-06 23:33
memberNikola Knezevic17-Aug-06 23:33 
GeneralThank You much Pin
marek.pastorek23-May-06 0:03
membermarek.pastorek23-May-06 0:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170924.2 | Last Updated 30 Nov 2004
Article Copyright 2004 by LimeyRedneck
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid