I am trying to add a custom cursor to my winforms app
i cant figureout how to do it and when i look it up its not working
30 Replies
What have you tried and what doesn't work?
jigneshon
C# 4 All
C# Tutorial – How To Use Custom Cursors [Intermediate]
Custom cursors are something that you don’t need to use very often, but when you do need them, they can make a huge difference in the usability of your program. So today we are going to take …
i bet it works
i am just really confused on where to put the code snippets it puts there
myControl
there seems to be the control you want the cursor to show in
So if you want it to show on the whole window, it would be the main form or whateverokay
So the code would probably go into the constructor of that main form
so like this one?
ye
okay
would i just putr the code with myControl in this area then?
but where would this part go
in the same place but a different line?
In the constructor as well
is the onstructer this part?
i am geussing it is\
No
oh
where is the constructer
$structure
Constructor is a method without a return type and with the same name as the class it's in
If you don't have one, make one
this part then?
i am really confused
I guess
InitializeComponent
could work as wellokay
There is no constructor in this screenshot btw
it says that myControl isnt in the context
i
Well, yeah
As I said, you should reference the control whose cursor you want to set
okay
ohhh i just realized what you meant
okay so now the program wont open at all
are there warnings in compilation?
InitializeComponents
is almost always called from the constructor, so you could find the constructor via the reference thereno there is not