|
-
Jul 29th, 2004, 08:37 AM
#1
Thread Starter
Addicted Member
Mouse pointer in listview
Hi
I want to change the mouse pointer when it moves onto a listview to a hand. I tried to put the following line of code in the mouse hover event of the listview:
Me.Cursor = Cursors.hand
the problem is that cursors.hand doesnt exist in that sub.
Does anyone know how I can get arouind this?
Thanking you in advance
PORRASTAR
-
Jul 29th, 2004, 08:40 AM
#2
No code needed at all.
the listview should have a cursor property that you can set directly from the designer.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
-
Jul 29th, 2004, 10:58 AM
#3
Hyperactive Member
I didn't understand.....which is the problem in a routine like this one?:
VB Code:
Private Sub ListView1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.MouseHover
Me.Cursor = Cursors.Hand
End Sub
Live long and prosper (Mr. Spock)
-
Jul 29th, 2004, 11:02 AM
#4
Fanatic Member
I'm not sure... but doesn't Me mean whatever object is currently processing that code?
So at that instant the object processing that code is the listview, so wouldn't Me mean the Listview?
I don't know about this really... but that's what I thought. I never, EVER, use Me though myself. I stay away from it because I am never sure what Me actually is. Just reference the actual form so much better when reading your code!
In my opinion anyway... but i'm probably speaking garbage about the Me thing being the object processing the code at the moment, i dunno really.
edit: although thinking about that now... if you used Me.Cursor, the code would have gone mad because cursor doesn't belong to the listview control, only the form if i'm right... i'm not sure lol!!!
I should stop confusing myself!
-
Jul 29th, 2004, 11:15 AM
#5
Hyperactive Member
Dear Lithia, when you write 'Me' and add a point you unchain the intellisense that shows a lot of informations. If among them you can find your listview, surely Me is meaning the actual Form. If Me were intended as your listview, you'd see only its properties and methods.....I think!
Live long and prosper (Mr. Spock)
-
Jul 29th, 2004, 11:35 AM
#6
yes ME refers to the class only
so in your own class you can use ME and since in .net forms are classes, using ME signifies accessing the form
and alextyx i didnt see anything wrong with ur code
VB Code:
Private Sub ListView1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.MouseHover
Me.Cursor = Cursors.Hand
End Sub
-
Jul 29th, 2004, 12:23 PM
#7
Fanatic Member
thanks for reasuring me! I knew Me either meant what i thought it meant, or the class
-
Jul 29th, 2004, 01:37 PM
#8
Hyperactive Member
Yes Kleinma, but I wrote that code because PORRASTAR said he has found some problem (that I didn't)while writing it. As you, I don't understand which is the problem. I think the code is right. So I have to wait for PORRASTAR's reply to understand better his question!
Live long and prosper (Mr. Spock)
-
Jul 29th, 2004, 01:59 PM
#9
Originally posted by alextyx
Yes Kleinma, but I wrote that code because PORRASTAR said he has found some problem (that I didn't)while writing it. As you, I don't understand which is the problem. I think the code is right. So I have to wait for PORRASTAR's reply to understand better his question!
gotcha... to be honest, i though you originally started the thread.. thats why i was a little confused
maybe he doesnt have System.Windows.Forms in his projects imports list so thats why he says Cursors.Hand doesnt exist...
cause he needs to either have that imported, or use the fully qualified
System.Windows.Forms.Cursors.Hand
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|