473,396 Members | 1,915 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.

Clock C# Windows Application

Inbaraj
76
Hi...

I am trying to put a Digital Clock in my Application I tryed that with timer control... Is it possible to put a clock without using the timer control.... Help me with some codeing...

With reg
Inba
Jun 25 '07 #1
7 3504
vanc
211 Expert 100+
Timer is a component to get real time from machine to render your digital clock, it's the easiest way to get time. Is it not the thing you want to?

cheers.
Jun 25 '07 #2
nmsreddi
366 256MB
Hello

As your application is windows based ,i dont think there is a best way than the timer control ,if its a web application you can have many options using script.
Jun 25 '07 #3
kenobewan
4,871 Expert 4TB
What else have you tried so far?
Jun 25 '07 #4
Inbaraj
76
What else have you tried so far?
I tryed with timer.... But i am asking is there any other way.... Thats all

reg
Inba
Jun 25 '07 #5
Frinavale
9,735 Expert Mod 8TB
I tryed with timer.... But i am asking is there any other way.... Thats all

reg
Inba
Are you developing a web application or desktop application?
(I'm pretty sure that the timer is the best way for a desktop application)

-Frinny
Jun 25 '07 #6
Inbaraj
76
Are you developing a web application or desktop application?
(I'm pretty sure that the timer is the best way for a desktop application)

-Frinny
hi...
I am developing Desktop application......

reg
Inba
Jun 26 '07 #7
i think you must use timer and using Tick() event with this code like that :
Expand|Select|Wrap|Line Numbers
  1. private void timer1_Tick(object sender, EventArgs e)
  2.         {
  3.  
  4.             String[] Time = lblTimeZone.Text.Split(':');
  5.             int Minute = Convert.ToInt32(Time[0]);
  6.             int sconds = Convert.ToInt32(Time[1]);
  7.             timer1.Interval = 1000;
  8.             sconds--;
  9.  
  10.             if (sconds <=0)
  11.             {
  12.                 Minute--;
  13.                 string strMinute = Minute < 10 ? "0" + Minute.ToString() : Minute.ToString();
  14.                 Time[0] = strMinute;
  15.                 lblTimeZone.Text = String.Join(":", Time);
  16.                 sconds = 59;
  17.             }
  18.             string strSconds = sconds < 10 ? "0" + sconds.ToString() : sconds.ToString();
  19.             Time[1] = strSconds;
  20.             lblTimeZone.Text = String.Join(":", Time);
  21.             this.Refresh();
  22.  
  23.         }
  24.  
Hope This Code Help you .
Oct 9 '10 #8

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

Similar topics

3
by: James Harriman | last post by:
Hi, I need to be able to measure a time interval in milliseconds on a windows machine. I have tried using time.clock() but it appears to measure time in seconds...Is there a way to measure time...
18
by: Giovanni Bajo | last post by:
Hello, I experimented something very strange, a few days ago. I was debugging an application at a customer's site, and the problem turned out to be that time.clock() was going "backwards", that...
5
by: yinglcs | last post by:
Hi, I am following this python example trying to time how long does an operation takes, like this: My question is why the content of the file (dataFile) is just '0.0'? I have tried "print...
9
by: Ron Adam | last post by:
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the...
8
by: Theo v. Werkhoven | last post by:
hi, In this code I read out an instrument during a user determined period, and save the relative time of the sample (since the start of the test) and the readback value in a csv file. #v+...
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
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.