Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SelectOnEntry not working for grid textbox
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00696230
Message ID:
00696250
Vues:
14
I have a class by Marcia Akins. You can find it in KiloFox book, but since Marcia published it here few times, I think, it's Ok to repeat:
********************************************************************
*  Description.......: NumericTextBox.GotFocus
*  Calling Samples...:
*  Parameter List....:
*  Created by........: Marcia Akins
*  Modified by.......:
********************************************************************
with this
*** Save the original input mask
	if .parent.class = 'column'
		.InGrid = .t.
		.cOldInputMask = .parent.inputmask
*** Remove separators from input mask
		.parent.inputmask = strtran( .cOldInputMask, ',', '' )

	else
		.cOldInputMask = .inputmask
*** Remove separators from input mask
		.inputmask = strtran( .cOldInputMask, ',', '' )
	endif
	if .selectonentry
		textbox::gotfocus()
		.selstart = 0
		.sellength = 999
		nodefault
	endif
endwith
********************************************************************
*  Description.......: NumericTextBox.LostFocus
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........: Marcia Akins 
*  Modified by.......: 
********************************************************************
if this.InGrid
   this.parent.InputMask = this.cOldInputMask
else
	this.InputMask = this.cOldInputMask
endif




>Maybe my perception of this command is incorrect...
>
>Was hoping to select the entire field value of the textbox in a grid column when i click into the textbox. Users can enter a value of 99.9 into the text box. Want to avoid having the user click into the text box at the position to the right of the decimal. Was expecting SelectOnEntry to select the entire value. Instead, the cursor is placed wherever the user clicked.
>
>I have Format = K and SelectOnEntry = .T. for both the COLUMN properties and for the textbox in the column.
>
>Am using Nick's GridHighlighter. There is a "lSelectOnEntry" property on his class and i have set this to TRUE. Doesnt help. And tabbing from one column into this 99.9 column also does not select the entire field value.
>
>Any ideas?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform