Re: Reversing changes made by mousemove event
- From: "Saucer Man" <saucerman@xxxxxxxxxx>
- Date: Sat, 6 Oct 2007 14:42:49 -0400
Sorry about that. The problem was that I did not have an icon set for the
form. So I was getting the "drag" box. Thanks for the help!
--
Thanks.
"Rick Rothstein (MVP - VB)" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx> wrote in
message news:uDkJuAECIHA.5960@xxxxxxxxxxxxxxxxxxxxxxx
The reason Larry's code didn't work for you is you neglected to tell us
that your Label controls were in a control array, so Larry gave you code
for individual Labels.
I'm not sure what you are trying to say in your last sentence... it looks
like you are saying that your modified code doesn't work with the control
array)... the modified code you posted works fine on my system.
Rick
"Saucer Man" <saucerman@xxxxxxxxxx> wrote in message
news:b8PNi.16337$Fa.12026@xxxxxxxxxxxxxxxxxxxxxxxxx
Ok. It is working with one label. I have a label control so this is how
I modifed it. It doesn't work with the control array of labels.
Private Sub Label2_DragDrop(Index As Integer, Source As Control, X As
Single, Y As Single)
If Source Is Label2(Index) Then
Label2(Index).Drag vbEndDrag
MsgBox "Clicked"
End If
End Sub
Private Sub Label2_DragOver(Index As Integer, Source As Control, X As
Single, Y As Single, State As Integer)
If (State = vbLeave) And (Source Is Label2(Index)) Then
Label2(Index).Drag vbEndDrag
End If
End Sub
Private Sub Label2_MouseMove(Index As Integer, Button As Integer, Shift
As Integer, X As Single, Y As Single)
Label2(Index).DragIcon = Me.Icon ' Use whatever pointer you want
shown
Label2(Index).Drag vbBeginDrag
End Sub
--
Thanks.
"Rick Rothstein (MVP - VB)" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx> wrote in
message news:OjuaPRDCIHA.536@xxxxxxxxxxxxxxxxxxxxxxx
Start a new project, add a Label control to the form somewhere and
copy/paste Larry's code into the code window. Then run the project and
move the mouse around watching the cursors shape as it moves in and out
of the Label's area... I think you will be surprised. Larry's code is
letting the built-in Windows drag "alert" mechanism handle the icon
changes as the mouse is moved in and out of the Label's boundary.
Rick
"Saucer Man" <saucerman@xxxxxxxxxx> wrote in message
news:lWNNi.1327$Qa.928@xxxxxxxxxxxxxxxxxxxxxxxxx
I'm confused with this. This is dragging the labels. I just want to
make them appear as link. What am I missing?
--
Thanks.
"Larry Serflaten" <serflaten@xxxxxxxxxxxxxx> wrote in message
news:efZDu%23ACIHA.464@xxxxxxxxxxxxxxxxxxxxxxx
"Saucer Man" <saucerman@xxxxxxxxxx> wrote
When I move the mouse off of the labels I want to reverse the changes
but I
am getting unstable results. Sometimes the changes reverse sometimes
they
don't. Here is what I have.
One of the problems is sometimes I can move from one of the popped up
menus
to another label without going over the image control. Is there a
better
way to do this?
If you are not supporting keyboard input, (mouse only) then this
method
can work well. If you plan to support keyboard input, then expect
keyboard
input to be interrupted while the mouse is over a label. (or use
another
method....)
LFS
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Label1.DragIcon = Me.Icon ' Use whatever pointer you want shown
Label1.Drag vbBeginDrag
End Sub
Private Sub Label1_DragDrop(Source As Control, X As Single, Y As
Single)
If Source Is Label1 Then
Label1.Drag vbEndDrag
MsgBox "Clicked"
End If
End Sub
Private Sub Label1_DragOver(Source As Control, X As Single, Y As
Single, State As Integer)
If (State = vbLeave) And (Source Is Label1) Then
Label1.Drag vbEndDrag
End If
End Sub
.
- References:
- Reversing changes made by mousemove event
- From: Saucer Man
- Re: Reversing changes made by mousemove event
- From: Larry Serflaten
- Re: Reversing changes made by mousemove event
- From: Saucer Man
- Re: Reversing changes made by mousemove event
- From: Rick Rothstein \(MVP - VB\)
- Re: Reversing changes made by mousemove event
- From: Saucer Man
- Re: Reversing changes made by mousemove event
- From: Rick Rothstein \(MVP - VB\)
- Reversing changes made by mousemove event
- Prev by Date: Re: Reversing changes made by mousemove event
- Next by Date: Re: How to show Title when minimized on a borderless form without a titlebar?
- Previous by thread: Re: Reversing changes made by mousemove event
- Next by thread: Re: Reversing changes made by mousemove event
- Index(es):