I have worked out why it is
Private Sub OwnerForm_MouseMove(button As Integer, Shift As Integer, X As Single, Y As Single)
Static rec As Boolean, MSG As Long
MSG = X / Screen.TwipsPerPixelX
Debug.Print ("WM_LBUTTONUP:" & WM_LBUTTONUP)
Debug.Print ("MSG:" & MSG)
Debug.Print ("X:" & X)
Debug.Print ("Screen.TwipsPerPixelX:" & Screen.TwipsPerPixelX)
If rec = False Then
rec = True
Select Case MSG
Case WM_LBUTTONDBLCLK:
'RaiseEvent MouseDown(1)
Case WM_LBUTTONUP:
RaiseEvent MouseDown(1)
Case WM_RBUTTONDBLCLK:
'RaiseEvent MouseDown(1)
Case WM_RBUTTONUP:
'RaiseEvent MouseDown(1)
End Select
rec = False
End If
The "X" changes at different points to different numbers, I am not sure if it changes to the same every single time.
EDIT: Dunno how to fix it though. Bacillus, you where saying something about the threading. I have no idea about the treads. The "X" changes when you start a new simulation both inside and outside the debug and the numbers created are different to eachother everysingle time inside the debug, outside the debug they are the same as eachother, but different from inside the debug.