View Single Post
07-19-2010, 02:46 AM
#9
geforce is offline geforce
Status: Member
Join date: Jul 2006
Location: UK
Expertise: Programming - PHP & MySQL
Software: Photoshop and Notepad++
 
Posts: 216
iTrader: 2 / 100%
 

geforce is on a distinguished road

Send a message via AIM to geforce

  Old

I've run the timer in a htread and that did not help either.

Code:
        public static System.Timers.Timer aTimer;

        public void Form1_Load(object sender, EventArgs e)
        {
            Thread thread = new Thread(new ThreadStart(Timer));
        }

        public static void Timer()
        {
            // Create a timer with a three second interval.
            aTimer = new System.Timers.Timer(3000);

            // Hook up the Elapsed event for the timer.
            aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);

            // Set the Interval to 2 seconds (2000 milliseconds).
            aTimer.Interval = 2000;
            aTimer.Enabled = true;
        }
I'm not the best C# coder as I hardly use it, so be gentle lol.

Cheers

Reply With Quote