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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding a precise coordination /location in a edit text field

Status
Not open for further replies.

robertcollins

Programmer
Mar 19, 2001
9
US
Hi;
I want to open a combo box after locating a perticular word in a edit box to suggest and select corrections.

Problem is it is hard to calculate precisely X and Y coordinate since the cursor is not on that perticular word. Something like following gives me very inexact location:
thisform.text1.width = len(lcOption)+12
thisform.text1.Left = col()
thisform.text1.top = row()+2
thisform.text1.visible = .t.

Thanks.

Robert
 
Robert

The X and Y coordinates are available in the .MouseDown event of the EditBox.

LPARAMETERS nButton, nShift, nXCoord, nYCoord

Chris :)

 
U have to create a formula between edtField.Width&Left, fontmetric(char width&Height). Have fun
 
Nefra, there is TXTWidth() and TXTHeight() functions in VFP that does this for you. I guess they could be used to calculate the location in points.

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top