Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting Editbox's Line and Column position
Message
From
02/02/2009 08:46:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
01/02/2009 16:41:50
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01378690
Message ID:
01378733
Views:
32
>Hi
>
>I'd like to get Editbox's Line and Column position.. due to each keypress and mousedown fireup..
>
>Is it any property to get it? Method? Something else?

The user can click to put the cursor between two characters, or he can select a piece of text.

.SelStart and .SelLength will give you the information.

You might compare the contents of the EditBox - the .Value property - to see how many CR+LF (note 1) there are before .SelStart (for the row), and how many characters there are between the last CR+LF and .SelStart (for the column). Unfortunately, this doesn't take into account automatic word-wrap at the end of each line. I don't know whether there is a more direct, and more complete, way of getting this information.


(1) carriage-return + linefeed, chr(13) + chr(10), is the combination usually inserted if the user presses ENTER.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform