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

Posted on 2011-03-21
Medium Priority
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?
Question by:jl66
  • 2
  • 2
LVL 86

Accepted Solution

Mike Tomlinson earned 2000 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


Author Comment

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

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 2000 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.  =)

Author Closing Comment

ID: 35185116
Thank you  so much.

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article describes and provides a custom-made tool I wrote to give businesses a means of identifying commercial music content, without having to expend too much effort. Business recordings are easily identified from possibly illegal music files …
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
Through the video, you can check the migration process of Outlook PST file to PDF. Kernel for Outlook to PDF tool can convert Outlook emails with all attributes like Subject, To, From, Cc, Bcc and other folders such as Inbox, Outbox, Sent Items, Jun…

607 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