473,385 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

System.Timers.Timer.Tick does not exist

In a Codeproject tutorial,
http://codeproject.com/cs/miscctrl/f...&select=785273
System.Timers.Timer.Tick is used, but apparently no such 'property'(?)
exists. What is the correct coding?
// Code --------------------------------

private System.Timers.Timer rotateTimer = null;

public void StartRotation(bool state)
{
rotateTimer = new System.Timers.Timer();
rotateTimer.Tick += new EventHandler(OnTimedEvent);
rotateTimer.Interval= 500;
rotateTimer.Enabled = true;
}

// -------------------------------------
thank you very much!
, Teis
Nov 16 '05 #1
8 7468
Teis Draiby <te*************@draiby.com> wrote:
In a Codeproject tutorial,
http://codeproject.com/cs/miscctrl/f...&select=785273
System.Timers.Timer.Tick is used, but apparently no such 'property'(?)
exists. What is the correct coding?


Well, it's not a property, it's an event. However, it's an event on
System.Windows.Forms.Timer, not System.Timers.Timer.

Looks like that's a bug in the web page - I can't be bothered to sign
up, so I don't know whether the same bug is also in the downloadable
sources.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Teis Draiby <te*************@draiby.com> wrote:
In a Codeproject tutorial,
http://codeproject.com/cs/miscctrl/f...&select=785273 System.Timers.Timer.Tick is used, but apparently no such 'property'(?)
exists. What is the correct coding?


Well, it's not a property, it's an event. However, it's an event on
System.Windows.Forms.Timer, not System.Timers.Timer.

Looks like that's a bug in the web page - I can't be bothered to sign
up, so I don't know whether the same bug is also in the downloadable
sources.


Build Succeeded
You saved my tutorial. The code is wrong the downloadable file as well.
Maybe it is .NET beta style?

Thank you for your valuable help
,Teis
Nov 16 '05 #3
Teis Draiby <te*************@draiby.com> wrote:
Build Succeeded
Goodo :)
You saved my tutorial. The code is wrong the downloadable file as well.
Oh dear :(
Maybe it is .NET beta style?


It looks like it was submitted during the beta, yes. Maybe you should
contact the author to get it corrected?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4
> It looks like it was submitted during the beta, yes. Maybe you should
contact the author to get it corrected?


The correction is now posted in the discussion part (there was no email
available).

thanks, Teis
Nov 16 '05 #5
Teis Draiby <te*************@draiby.com> wrote:
In a Codeproject tutorial,
http://codeproject.com/cs/miscctrl/f...&select=785273
System.Timers.Timer.Tick is used, but apparently no such 'property'(?)
exists. What is the correct coding?


Well, it's not a property, it's an event. However, it's an event on
System.Windows.Forms.Timer, not System.Timers.Timer.

Looks like that's a bug in the web page - I can't be bothered to sign
up, so I don't know whether the same bug is also in the downloadable
sources.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #6

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Teis Draiby <te*************@draiby.com> wrote:
In a Codeproject tutorial,
http://codeproject.com/cs/miscctrl/f...&select=785273 System.Timers.Timer.Tick is used, but apparently no such 'property'(?)
exists. What is the correct coding?


Well, it's not a property, it's an event. However, it's an event on
System.Windows.Forms.Timer, not System.Timers.Timer.

Looks like that's a bug in the web page - I can't be bothered to sign
up, so I don't know whether the same bug is also in the downloadable
sources.


Build Succeeded
You saved my tutorial. The code is wrong the downloadable file as well.
Maybe it is .NET beta style?

Thank you for your valuable help
,Teis
Nov 16 '05 #7
Teis Draiby <te*************@draiby.com> wrote:
Build Succeeded
Goodo :)
You saved my tutorial. The code is wrong the downloadable file as well.
Oh dear :(
Maybe it is .NET beta style?


It looks like it was submitted during the beta, yes. Maybe you should
contact the author to get it corrected?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #8
> It looks like it was submitted during the beta, yes. Maybe you should
contact the author to get it corrected?


The correction is now posted in the discussion part (there was no email
available).

thanks, Teis
Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Teis Draiby | last post by:
In a Codeproject tutorial, http://codeproject.com/cs/miscctrl/first_control.asp?df=100&forumid=1690&select=785273 System.Timers.Timer.Tick is used, but apparently no such 'property'(?) exists....
4
by: Bilo | last post by:
I have a Windows Forms Class MainGUI I have declared MainGUI maingui; public System.ComponentModel.Container components = new Container(); in the Class I call another class MediaDriver with...
10
by: WhiteSocksGuy | last post by:
Help! I am new to Visual Basic .Net (version 2002) and I am trying to get a System.Timers.Timer to work for me to display a splash screen for about two seconds and then load the main form. I have...
2
by: User | last post by:
Hi, What is the best way to release all resources holded by the Timer (myTimer from class System.Timers.Timer)? Is it: 1- myTimer.dispose 2- myTimer.enabled = false 3- myTimer.close
2
by: cntams | last post by:
All, I have a Windows Service and it has one System.Timers.Timer that fires every 500 milliseconds. Now I have noticed that there's a bug in System.Timers.Timer when it's being used combined with...
4
by: TheJediMessiah | last post by:
Hi, I have a number of objects for which I want to create a timer for. So for each object I would like to have a timer which runs at a different interval. For a single timer I know how to...
9
by: archana | last post by:
Hi all, I want to know about interval of timer. I am using timer in windows service.I head somewhere that when i set interval property of timer while setting interval, restart time of Pc is...
5
by: Tony Gravagno | last post by:
I have a class that instantiates two Timer objects that fire at different intervals. My class can be instantiated within a Windows Form or from a Windows Service. Actions performed by one of the...
2
by: chandu | last post by:
Hello, can u please explain the difference between the two System.Timers.Timer events i want to use the timer in windows service.. please clarify.. thank u chandu
5
by: Brian | last post by:
Hello all. I have a simple application that I was using to test and understand the System.Timers.Timer and noticed that when I stop the application, on occasion, it throughs the following...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.