Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
Error: No overload for
matches delegate 'System.EventHandler'
Sam
14y
7.9k
1
Reply
Hello fellows,
I keep getting the error:
"No overload for
'
comPort1_DataReceived
'
matches delegate
'
System.EventHandler
'
"
Anyone knows what
'
s wrong?
Thanks.
I have 2 methods reading from 2 serial ports.
I wish to have a watchdog timer that will activate the other port if a port does not get data within certain time.
(Normally, if data was received, it will reset the timer for each data cycle. If the timer does not resets (Stop) within certain time (no data), we open the other port).
Here is what I have: (in general terms...)
System.Windows.Forms.
Timer
wait=
new
System.Windows.Forms.
Timer
();
private
void
comPort1_DataReceived(
object
sender,
SerialDataReceivedEventArgs
e)
{
//some code
}
public
void
comPort2_DataReceived(
object
sender,
SerialDataReceivedEventArgs
e)
{
if wait.Interval> {do something}
wait.Tick +=
new
EventHandler
(comPort1_DataReceived);
wait.Interval = 500;
wait.Start();
// Code
wait.Stop();
}
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Can somebody please translate this peice of code?
How to change text color in c#