Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remember position in editbox.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00418229
Message ID:
00418267
Vues:
26
>I have an editbox on a form that fires some code the first time the interactivechange() event happens. Problem is that due to the code that's run, I loose focus of the editbox. Simple solution was to do a setfocus() where this is happening.
>
>My problem is that I want to put the cursor back at the exact same location within the editbox.
>
>Is there a way to do this? (I hope, I hope)

Capture the SelStart property and save it - this is either thestart of the presently selected block of text in the editbox, or if no text is selected, the insertion point. SelLength indicates the size of the selected textblock; it will be 0 if nothing is selected, in which case SelStart is the insertion point. Your only problem comes where you've marked a block of text - the cursor may be at the start or endpoint of the block depending on whether you anchored at the right edge or left edge to select.

To restore the cursor/selected block on return, just restore SelStart and SelLength.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform