Solved

Is there any timer working with the GUI controls in C#?

Posted on 2011-03-21
4
276 Views
Last Modified: 2012-05-11
Have a need to do this: the color in picture Box changes in two minutes. Is there any timer for the operation?
0
Comment
Question by:jl66
  • 2
  • 2
4 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 35184126
Yes...there is a Timer control in the Toolbox (the "Components" section by default).  Drop one on your form and set the Interval() property to 120,000.  Be sure to set the Enabled() property to true so it fires.  Now double click the "timer1" icon below your form to get the method stub (place your color changing code in there):
private void timer1_Tick(object sender, EventArgs e)
        {

        }

Open in new window

0
 

Author Comment

by:jl66
ID: 35184599
Thank you so much. If I want to do try-catch-finally, what kind of exceptions should I get for this timer?
0
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 500 total points
ID: 35184881
I don't understand the question...if you have a Try/Catch then the exceptions would be caught by the Catch block.  The timer won't care.  =)
0
 

Author Closing Comment

by:jl66
ID: 35185116
Thank you  so much.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now