Solved

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

Posted on 2011-03-21
4
275 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you  so much.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
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…

744 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

12 Experts available now in Live!

Get 1:1 Help Now