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

StatusBar and Displaying the time

Hello All,

I am working on an application and would like to display
the current time in the statusbar on the main form. Is
there an easy way to keep the current time displayed? I
know that I can always set the statusbar section text to
time.now but it seams like I would have to place this
where it would get called all of the time. Any thoughts.

Thanks
Brad
Nov 20 '05 #1
2 8179
Hi Brad,

You can Drag a Timer Control off the ToolBox onto your Form, or you
can create a System.Timers.Timer in your Form_Load. In either case, the
Timer would be set to go off every second and you'd update the StatusBar
in the Timer's event handler.

Regards,
Fergus
Nov 20 '05 #2
* "Brad Sanders" <an*******@discussions.microsoft.com> scripsit:
I am working on an application and would like to display
the current time in the statusbar on the main form. Is
there an easy way to keep the current time displayed? I
know that I can always set the statusbar section text to
time.now but it seams like I would have to place this
where it would get called all of the time. Any thoughts.


Add a Timer control from the toolbox to the form
('System.Windows.Forms.Timer'), set its 'Interval' property to '1000'
and the 'Enabled' property to 'True'. Then add code like this to its
'Tick' event handler:

\\\
sbStatusBar.Text = Today.Date.ToString("dd.MM.yyyy") & ", " & TimeOfDay.ToString("hh:mm:ss")
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Doug | last post by:
In vb6 there was a style property that made this quite simple. Is there a simple alternative in .NET? Thanks.
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
3
by: Job Lot | last post by:
I am creating a custom StatusBar control which houses a ProgressBar control. How can I show all the properties of embedded ProgressBar control on design time? I want the property window of...
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...
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...
1
by: Dave Taylor | last post by:
I have a StatusBar control docked to the bottom of the screen, a horizontal splitter control just above that, and then a DataGrid control that has its docking property set to Fill above that. (I'm...
1
by: herve | last post by:
Hi, everybody I'm working with wxPython 2.8.1.1. Does anybody know how to change the foreground colors in a wx.StatusBar
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: 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
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...

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.