Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SelectOnEntry in Textbox
Message
De
03/12/2003 08:55:29
Mike Sue-Ping
Cambridge, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00855187
Message ID:
00855386
Vues:
18
Hi Nick,

While your suggestions adds some great functionality to the issue, one problem still remains that I have found. Instead of describing it again, Christian's original comment follows:

>...except when the value is longer than the textbox shows, which results in shifting the entire selected text to the left. That is confusing for the user.
>

This still occurs in your code. Do you know of anyway to prevent it? Thanks again for your input.

Regards,

Mike


>I wrote about this exact problem in Re: How to select textbox when mousing in Thread #846750 Message #846833
>I will just repeat it here:
>
>< SNIP > *******************************************************************
>The extended features of the Left Mouse click :)
>
>1. One short click selects the whole textbox value
>2. You still can do the manual text selection in the box
>3. If you click and hold the mouse for more than one second, the cursor will stay where you clicked and you still can do the normal editing.
>4. As a bonus :) DoubleClick selects the existing text and the trailing spaces (but not the leading spaces (if any).
>
>
>*** MouseDown() event
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>this.WhatsThisHelpID = INT(SECONDS())
>
>***MouseUp() event
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>IF nButton = 1
>	DO CASE
>		CASE ABS(INT(SECONDS()) - THIS.WHATSTHISHELPID ) > 1 && 1 sec delay
>			* do nothing - leave the mouse pointer where it landed,
> allowing to position within the textbox
>		CASE THIS.SELLENGTH = 0
>			THIS.SELSTART = 0
>			THIS.SELLENGTH = 1000
>		CASE THIS.SELLENGTH > 0
>			* Leave the selection made as is
>	ENDCASE
>ENDIF
>
>I employed the rarely used WhatsThisHelpID property to hold the SECONDS() value
>just for this example. Of course, you can use a custom property for that.
>
>I used THIS.SELLENGTH = 1000 for the whole text selection to avoid
>unnecessary function calls.
>
>Using THIS.SELSTART = 0 and THIS.SELLENGTH = LEN(ALLTRIM(this.Value)) or THIS.SELLENGTH = LEN(ALLTRIM(this.Text)) is not reliable
>if the textbox value has the leading spaces.
>
>< END SNIP > ****************************************************************
>
>P.S. Of course, you can just throw away the extra features if you don't need them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform