Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleDetermine where the user clicked on a form
Keywordsform, click, position
CategoriesTips and Tricks
 
The problem is the Click event handler does not tell you the coordinates where the user clicked. Use a form-level variable to save the coordinates in the MouseUp event handler. Then use those coordinates in the Click event handler.
 
Private Sub Form_MouseUp(Button As Integer, Shift As _
    Integer, X As Single, Y As Single)
    ClickX = X
    ClickY = Y
End Sub

Private Sub Form_Click()
    MsgBox "Clicked (" & Format$(ClickX) & ", " & _
        Format$(ClickY) & ")"
End Sub
 
Formatted by Neil Crosby
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated