Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture Top-Left position 1

Status
Not open for further replies.

philipad

Technical User
Feb 12, 2006
23
CY
Hi all...

In Visual Basic 6 every point in the form has a top-left position that is shown in the standard toolbar. What I want to do is to write a program which captures the top-left position and store it in an array. For example if I have a map of UK when someone press the point where the London is, the values will be stored as cityLeft(0)=1200 cityTop=900.

Anyone can help me?

thanks
 

The Form Top and Left properties describe where the form starts within its container. If you want to find where someone clicks in an Image, use the Image MouseDown event, which gives X and Y values for the point where the click occurred, measured from the topleft corner of the image control.
Code:
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
MsgBox "North = " & Y & "   West = " & X
End Sub

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top