[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