✅ would like help to fix my timer for windows forms
Hi, I’m in college and am working on my final project, I’m experiencing an issue with my timer (“no overload for ‘timer1_Tick’ matches delegate ‘EventHandler’”) in my windows form design, I am also looking to redo my project with instantiation to make it more efficient, help would be very much appreciated 👍🏼👌
(Only properly started using C# a few months ago)
22 Replies
That means its signature doesnt match the delegate type
EventHandler
lets check what signature the timer tick event has
public delegate void EventHandler(object? sender, EventArgs e);
Do you see the difference?Embarrassed to say I don’t really know lol?
object?
vs object
try slapping a questionmark at the end of object
in your timer1_Tick
method
only thing I can think of, because otherwise it looks valid to me
also, your while loops are just for loops :plol I know
It’s an on going joke with my teacher
But yeah it still isn’t happy with me ),:
verify that you dont have two
timer1_Tick
methodsI don’t think so
Find command, only shows the one
works fine here
are you sure its not a ghost problem?
Maybe?
How do you solve that?
close down visual studio
open a terminal in your project root
dotnet build
does it work?How do I open the terminal?
For real?
…
there are thousand ways
easiest is...
open folder in file explorer
shift right click in folder
"open in terminal/command prompt/powershell"
Ok got windows powershell
dotnet build
Yup
works? errors?
No errors
Hopefully it works now
okay, then its likely a ghost error, meaning VS cached the error and missed that you fixed it
It works
IT WORKSSS
Thank you 👍🏼
np