473,799 Members | 3,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3651
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*******@bite me.net> wrote in message
news:EW******** *************@n ews.easynews.co m...
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@_spamkille r_bobpowell.net > wrote in message
news:uu******** ******@tk2msftn gp13.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*******@bite me.net> wrote in message
news:b_******** *************@n ews.easynews.co m...
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@_spamkille r_bobpowell.net > wrote in message
news:uu******** ******@tk2msftn gp13.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
11131
by: authorking | last post by:
How to access a control in another form and how to make a form become a MDI container.
4
7275
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 form... Quite a mouthful however a good example of this is within the VS.NET 6 IDE. Grab your solution explorer panel and drop it outside of the IDE, then drag/drop it back in and watch it dock.
4
2100
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 frmmdi.SB.Panels(1).text = "files saved.." frmmdi --> Mdi Form name SB --> StatusBar
6
6336
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; document.getElementById('document.dane.accomp').removeChild(ostatni);
2
1356
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 second form (which was called from the first). Ideally when a button on the second form is pressed, the first one (main form) should update/refresh its UI.
6
4236
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. Before the main form is loaded I show the splash screen and then try to update the splash label to indicate the status. I cannot figure out the correct syntax. Here is a code snippet. My last line generates a
0
1136
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 EXCEPT FOR THE UNDERLINED PART. pLEASE HELP. thIS IS VISUAL BASIC 2005 An airplane has 15 rows (numbered 1 through 15), with six seats (labeled A, B, C, D, E, and F) in each row. . When the agent clicks on one of the text boxes, a second form...
4
1549
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 am having is updating text fields with a user's information on another form when double-clicking a MSFlexgrid row. Please help!
4
1738
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, and another form, (Form_Two) opens to which they can add the new item (in Field_Two). After adding the new item in F_Two I want the combobox in F_One to requery without having to close and reopen F_One. I think I can do this with an After_Update...
0
9540
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10222
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10026
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.