473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 3631
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: authorking | last post by:
How to access a control in another form and how to make a form become a MDI container.
4
by: zav | last post by:
Hi all i`m having a small problem with windows forms, i`m attempting to provide the following functionality to a form. Ability to drag and drop another form onto a form and then to dock this...
4
by: rat | last post by:
i am having 3 panels(0,1 & 2) in a Statusbar. Using MDI form, i can access and set the text for the panels(0 and 2).. But how can i access the panel(1) from MDI Child form. like...
6
by: Leszek | last post by:
Hi. I wrote a script: function zmiana(ile){ while(document.getElementById('accomp').childNodes.length>1){ ostatni=document.getElementById('document.dane.accomp').lastChild;...
2
by: lucaoscar | last post by:
Hi all, as you can see from the level of my question, i am pretty new to c# and programming in general. situation: i would like to update the UI of a form (main form of my application) from a...
6
by: surfrat_ | last post by:
Hi, I have a project that loads a splash screen while initialization takes place. On the splash form is a label that I want to update with messages on what is happening with the initialization....
0
by: adalyc | last post by:
I NEED SOME GUIDENCE WITH UPDATING A COLLECTION OF ITEMS IN A LIST BOX WHEN THE USER CLICKS ON A BUTTON FROM ANOTHER FORM,, i HAVE LISTED THE PROBLEM PARTIALLY. I fIGURED OUT MOST OF THE PROBLEM...
4
by: parkergirl | last post by:
Hello, I am currently working on a project that has many tabs all on one form. Since you can only have so many controls on one form, my job is to seperate these tabs into forms. One problem that I...
4
by: Organizer | last post by:
I am using Microsoft Access 2007. I have a list in a dropdown combobox (Field_One) in a form (Form_One). Users have the option to click a button if the item they need does not appear in the combobox,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.