Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am using windows application,
I want display time only 30 seconds after 30 seconds automatically timeout,the time format is 00:00:00 want this way anyone help me
Posted
Updated 1-Feb-12 23:42pm
v2

Create a timer
Create a class level timeout counter.
Set the interval to 1/10th second.
Subscribe to the Tick event
Set the timeout counter to 300 (30 times 10 times a second)
Start the timer.
In the Tick handler, show the elapsed time in a label.
Reduce the timeout counter by one.
If the counter is less than or equal to 0, stop the timer, and do whatever it is you wanted.
 
Share this answer
 
Comments
Member 8614787 2-Feb-12 6:23am    
Hi all of u
Thanks for your Reply i try to work all things it's working no problem Thanks.
But what my question is display time in Hours:Minues:seconds(00:00:01) this way and after 30 minutes its automatically signout this is my query i think it's clear for all(windows application asp.net with c#.net only)
OriginalGriff 2-Feb-12 6:27am    
Sorry - I don't understand what you are trying to achieve.
Could you give a little more detail?
Member 8614787 2-Feb-12 7:52am    
i am using windows application i need display time like(00:00:01)hours,minutes,seconds format after 30 minutes i want timeout message display usinh asp.net with c#.net
OriginalGriff 2-Feb-12 8:12am    
And which part can't you do?
Member 8614787 3-Feb-12 1:46am    
In my code just display current system time only but i want start from 00:00:00
time format i thing are you clear help with me
Stopwatch[^] control may helps you

See the below link also
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx[^]

Thanks
--RA
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900