Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting Editbox's Line and Column position
Message
De
02/02/2009 08:46:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
01/02/2009 16:41:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01378690
Message ID:
01378733
Vues:
28
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform