|
-
Dec 20th, 2009, 01:58 PM
#1
Thread Starter
PowerPoster
[RESOLVED] [VB6] -strange bug
when i try move my new control, with mouse in, my object don't move and the properties aren't, normaly changed(inlued other instances) 
but after i take the mouse out of control, the control works normaly.
heres the mouse move event inside of control:
Code:
Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If x > MousePos.x Then
mdMouseDirection = MouseDirectionRight
ElseIf x < MousePos.x Then
mdMouseDirection = MouseDirectionLeft
ElseIf y < MousePos.y Then
mdMouseDirection = MouseDirectionUp
ElseIf y > MousePos.y Then
mdMouseDirection = MouseDirectionDown
ElseIf x < MousePos.x And y < MousePos.y Then
mdMouseDirection = MouseDirectionLeftUp
ElseIf x < MousePos.x And y > MousePos.y Then
mdMouseDirection = MouseDirectionLeftDown
ElseIf x > MousePos.x And y < MousePos.y Then
mdMouseDirection = MouseDirectionRightDown
ElseIf x < MousePos.x And y > MousePos.y Then
mdMouseDirection = MouseDirectionRightUp
End If
MousePos.x = x
MousePos.y = y
mbMouseButton = Button
skShift = Shift
With UserControl
If GetCapture <> .hWnd Then SetCapture .hWnd
If ((x < 0 Or y < 0 Or x > .ScaleWidth Or y > .ScaleHeight) Or IIf(traTransparent = TransparentAutomatic Or traTransparent = TransparentManualy, GetPixel(UserControl.hDC, MousePos.x, MousePos.y) = UserControl.Backcolor, GetPixel(UserControl.hDC, MousePos.x, MousePos.y) = -1)) Then ' we're off the form
ReleaseCapture
blnEnter = True
MouseOverControl = 0
RaiseEvent MouseExit(mbMouseButton, skShift, CLng(MousePos.x), CLng(MousePos.y), mdMouseDirection)
mdMouseDirection = MouseDirectionNone
Else
If blnEnter = True Then
blnEnter = False
lngOldMouseX = MousePos.x
lngOldMouseY = MousePos.y
MouseOverControl = UserControl.hWnd
RaiseEvent MouseEnter(mbMouseButton, skShift, x, y, mdMouseDirection)
End If
End If
End With
RaiseEvent MouseMove(mbMouseButton, skShift, x, y, mdMouseDirection)
End Sub
and these problem happens in 1st time(after execute the project). then works normaly.
any help?
thanks
-
Dec 21st, 2009, 05:40 PM
#2
Thread Starter
PowerPoster
Re: [VB6] -strange bug
how the mouse stop "event" can block every instances of my object?
-
Dec 24th, 2009, 08:00 AM
#3
Thread Starter
PowerPoster
Re: [VB6] -strange bug
stilling testing. i found another information. if the mouse is out side of control, i can work normaly with control. but if i move the control to mouse position(i tested now), until i move the mouse every instances of control just stop(animation stops\pauses(after the mouse go out, the image is updated to correct one) and the control don't move
why these is appenning?
Last edited by joaquim; Mar 17th, 2010 at 04:23 PM.
-
Dec 27th, 2009, 09:31 AM
#4
Thread Starter
PowerPoster
Re: [VB6] -strange bug
what maskcolor, maskpicture and backstyle=0 has to do with mouse?
-
Jan 13th, 2010, 03:01 PM
#5
Thread Starter
PowerPoster
Re: [VB6] -strange bug
the problem was the keyword DoEvents, in animated gif function.
thanks
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
|