468,161 Members | 1,952 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,161 developers. It's quick & easy.

Updating Statusbar panels from another form?

Hi all,

I have an application with a few different Windows forms. I am trying to
update a statusbar panel's text that is in the main form, from another form.

When I set the statusbar and the statusbar panels to public and shared in
VS.net's property box it will work. However, whenever I make any
modifications to the main form it will remove the shared property and I will
get build errors about accessing the panels with "this.".

Is there a better way to make the text of the statusbar panels accessible
from other classes/forms?

Thank you for any help, I've about googled my eyes out looking for the
answer to this!
Nov 16 '05 #1
3 3463
Leave the statusbar field as private and add a property that accesses it
publicly.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TonyM" <sp*******@biteme.net> wrote in message
news:EW*********************@news.easynews.com...
Hi all,

I have an application with a few different Windows forms. I am trying to
update a statusbar panel's text that is in the main form, from another form.
When I set the statusbar and the statusbar panels to public and shared in
VS.net's property box it will work. However, whenever I make any
modifications to the main form it will remove the shared property and I will get build errors about accessing the panels with "this.".

Is there a better way to make the text of the statusbar panels accessible
from other classes/forms?

Thank you for any help, I've about googled my eyes out looking for the
answer to this!

Nov 16 '05 #2
Thanks for the quick Reply Bob, I have tried to add a property to set the
private statusbar field. However, when I add the "static" modifier to the
property, I can no longer see the private statusbar field within the
property.

Thanks again for any insight.
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:uu**************@tk2msftngp13.phx.gbl...
Leave the statusbar field as private and add a property that accesses it
publicly.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

Nov 16 '05 #3
Obviously not because the status bar field is an instance field.

Why do you think you need a static modifier?

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TonyM" <sp*******@biteme.net> wrote in message
news:b_*********************@news.easynews.com...
Thanks for the quick Reply Bob, I have tried to add a property to set the
private statusbar field. However, when I add the "static" modifier to the
property, I can no longer see the private statusbar field within the
property.

Thanks again for any insight.
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:uu**************@tk2msftngp13.phx.gbl...
Leave the statusbar field as private and add a property that accesses it
publicly.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by authorking | last post: by
6 posts views Thread by Leszek | last post: by
2 posts views Thread by lucaoscar | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.