Updating Statusbar panels from another form?

T

TonyM

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!
 
T

TonyM

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.
 
B

Bob Powell [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top