Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Edtbox handling on Enter for more lines
Message
De
21/07/2000 13:14:05
 
 
À
18/07/2000 23:39:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00394179
Message ID:
00395552
Vues:
10
>what should I do on giving user to press enter to get more lines in Edtbox?
>I have tried keypress event on nKeyCode is 13
>
>
>If nKeyCode = 13
>  nodefault()
>  nSelStart = This.selstart
>  This.value = Left(this.value, nSelStart-1) + chr(13) +;
>     iif(nSelstart < len(this.value), substr(this.value, nSelstart+1), [])
>
>endif
>
>
>It seem work fine if the line got many characters, but when I tried to type:
>
>A [enter] B [enter] C [enter]
>
>The out come is:
>[blank line]
>[blank line]
>[blank line]
>CBA
>
>Why? when did the edtbox get a Chr(10) character, I never assign or give it at all!!

That's because in your code you keep getting the leftmost position of the content of the edit box.

If your users are typing in the edit box ... You shouldn't have to do anything ... If you are appending string values to the current value of the edit box, then it's actually very simple ...

This code comes from a status viewer class used to keep up with scrolling status messages in lengthy processes. The code appears in an Update() method of the container object. Inside the container object is an edit box called "MD" This simple line of code moves the insertion pointer (And the view) to the end of the text string stored as the value of the edit box.

This.MD.SelStart = Len(This.MD.Value)

That's it.

Hope this helps ...

Jason
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform