View Single Post
  #2 (permalink)  
Old 04-25-2009, 07:15 AM
klaus's Avatar
klaus klaus is offline
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,457
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

This happens only with MouseMove and MouseUp on the desktop.
If you want to avoid getting values from outsides you must check if x and y are insides the form limits.
Code:
If x >=0 and x<= Form.Width and y>= 0 and y<=Form.Height Then
Be aware that there is also a difference in the behaviour of the MouseMove event between the desktop and the device. On the desktop the MousMove event is fired even without a MouseDown event, on the device the MouseMove event is only fired after a MouseDown event (the contact of the stylus is needed). To avoid this you should add a flag in the MousDown event, test it in the MouseMove event and set it back in the MousUp event:
Code:
Sub Form_MouseDown(x,y)
  FlagMouse = 
1
End Sub
 
Sub Form_MouseMove(x,y)
  
If FlagMouse = 1 Then
  
End If
End Sub
 
Sub Form_MouseUp(x,y)
  FlagMouse = 
0
End Sub
Best regards.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote