473,395 Members | 1,653 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,395 software developers and data experts.

WPF StatusBar Update Paradigm

ClubbieTim
I have an event that I would like to sandwich with "Loading..." and "Ready!" textblocks on my status bar. This is on a WPF application (as opposed to a web app).

This would be simply on a Windows Form, but in the world of WPF I am having an existential crisis.

Here's the jist:

XAML
Expand|Select|Wrap|Line Numbers
  1. <!--StatusBar-->
  2.         <StatusBar Height="30" Name="MasterStatusBar" VerticalAlignment="Bottom" >
  3.             <StatusBarItem Name="StatusBarStatus">
  4.                 <TextBlock Name="Status">Work</TextBlock>
  5.             </StatusBarItem>
  6.         </StatusBar>
  7.  
  8.         <!--Button-->
  9.         <Button HorizontalAlignment="Right" Margin="0,116,151,122" Name="button1" Width="75" Click="button1_Click">Button</Button>
  10.  
C#
Expand|Select|Wrap|Line Numbers
  1.         private void button1_Click(object sender, RoutedEventArgs e)
  2.         {
  3.             StatusBarItem StatusBarItem = (StatusBarItem)MasterStatusBar.FindName("StatusBarStatus");
  4.             TextBlock txt = (TextBlock)StatusBarItem.FindName("Status");
  5.  
  6.             txt.Text = "Loading...";
  7.  
  8.             //Some long process
  9.             Thread.Sleep(1500);
  10.  
  11.             txt.Text = "Ready";
  12.  
  13.         }
  14.  
Any suggestions would be greatly appreciated.
Feb 27 '08 #1
1 6768
I know it's an old post but:

You can access your textblock defined in the XAML document by giving a name.
So you only have to set:
Expand|Select|Wrap|Line Numbers
  1. Status.Text = "Ready";
  2.  
Oct 5 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Tonya | last post by:
Hi, Does anyone know how i can add controls to a progress bar. I have searched the internet but could not find any examples. what i want to add is a progress bar and a button. thx
18
by: Andrew Poulos | last post by:
If I manage to call the following bit of javascript in IE and MZ w = window.open("", "s", 'status=no,resizable=no,width=450,height=450'); I get a window that is not resizable and without a...
4
by: John J. Hughes II | last post by:
I have an MDI application and would like to display messages to the status bar of he parent window. I am really not happy about putting a status bar on every MDI window and would prefer it to only...
3
by: TonyM | last post by:
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...
9
by: Christian Blackburn | last post by:
Hi Gang, I've had this happen with a couple of controls now, but my patience has worn thin. Can somebody tell me why I can read/write to most objects on my form from my module, but not when...
2
by: Paul Remblance | last post by:
I have tried several approaches to update the mdiparent status bar from a module. A bit complicated as the path could be: Parent -> Child1 -> dialog1 -> module.sub (long process) Parent ->...
1
by: William Foster | last post by:
Good afternoon all, I am converting a program that does data validation on roughly 2 million records from running in Microsoft Excel to Microsoft Visual Basic 2003 ..NET; the problem I have is...
8
by: giddy | last post by:
hi , Does a singleton statusbas controller sound correct. I mean , is that how its done? I have a big app and i need to control the statusbar from within a number of custom controls , dynamic...
3
by: S. Viswanathan | last post by:
Hi everybody! In VB.NET 2005, MenuStrip and Statusstrip controls added. When the mouse over on the Menuitem its corresponding Tooptip text should be displayed in the statusstrip. How to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...

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.