Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2011-03-21
4
278 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 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