Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox
Message
De
16/04/2000 19:26:58
Liam O'Hagan
O'Hagan Programming Ltd
Irlande
 
 
À
16/04/2000 12:13:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00360078
Message ID:
00360202
Vues:
9
Hi Ed,

Thank you for your comments. You are quite right - it could get very confusing. The circumstances in which I would use SelStart would be limited but it is nice to have the option to position the cursor on certain text/edit boxes.

Regards,

Liam



>>Moises has raised an interesting point. I was asked a very similar question recently by a client. Another client asked me if I could save the position in a text box that she was editing so that, if she tabbed off it and tabbed back, she could resume editing at the point she left. I don't think there is a way to
>>establish the current position in a text box or edit box but perhaps someone can tell me I'm wrong ?
>>
>
>You can, but at the cost of Windows compatibility. Create a subclass of the textbox with two custom properties, OldSelStart and OldSelLength, initializing both to 0. Add the following to the GotFocus event:
>
>PROCEDURE GotFocus
>this.SelStart = this.OldSelStart
>this.SelLength = this.OldSelLength
>DODEFAULT()
>NODEFAULT
>ENDPROC
>
>Add the following to the LostFocus event:
>
>PROCEDURE LostFocus
>this.OldSelStart = this.SelStart
>this.OldSelLength = this.SelLength
>DODEFAULT()
>ENDPROC
>
>Note - doing this gives up the option that the user has now to click to a position in the textbox from another control and have the cursor positioned as they'd like. Once in the subclassed textbox, you can select, etc using the mouse as normal. This also sacrifices the normal behavior for a textbox that would otherwise select all on entry. YMMV - my experience has been that the end-user will get very, very confused.
Liam O'Hagan
MCP VFP Desktop Apps
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform