Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make textbox to be selected in a grid?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01126352
Message ID:
01126364
Vues:
22
>I have a grid with a column of baseclass textbox. I would like
>to see the entry in the textbox to be selected when user clicks in
>this column. The property SelectOnEntry of the textbox is set to .T.. But no matter what I do, it does not work.
>
>Here is what I tried so far. I put the following code in the GotFocus of the textbox:
>
>
>textbox::GotFocus
>NODEFAULT
>
>
>The above code work for a textbox that is not in a grid but does
>not seem to work in a grid.
>
>Any suggestions?
>
>Thank you.
*---------------------- Location Section ------------------------
*   Library: KCustCtl.vcx
*   Class:   CGridTextBox
*   Method:  GotFocus()
*----------------------- Usage Section --------------------------
*)  Description: 
*)		If specified to do so, set up column control for
*)		incremental serach

*   Scope:      Public
*   Parameters: None
*$  Usage:      
*$              
*   Returns:  Logical .T. by default
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	07/10/99 - KJM
*		MODIFIED	10/05/00 - KJM
*			Commented out the code that issues a SET ORDER to
*			This.cOrderTag. It's no longer needed since the 
*			Keyseek method uses the tag name in the SEEK command.
*     MODIFIED  06/24/05 - NN used correct colors to show in the grid
******************************************************************
IF THIS.lInGridActive
	IF THIS.lSeekMode
		THIS.lSeekMode = .F.
	ELSE
		IF THIS.lSearchPreview
			THIS.cHoldCaption = THIS.Parent.Header1.Caption
		ENDIF
	ENDIF
ENDIF

*-- CHANGE - NN - June 24, 2005 - 15:38:56
*     MODIFIED  06/24/05 - NN used correct colors to show in the grid
this.nBackColor = this.BackColor 
this.nForeColor = this.ForeColor

this.BackColor = this.Parent.Parent.HighlightBackColor
this.ForeColor = this.Parent.Parent.HighlightForeColor
*---------------------- Location Section ------------------------
*   Library: KCustCtl.vcx
*   Class:   CGridTextBox
*   Method:  LostFocus()
*----------------------- Usage Section --------------------------
*)  Description: 
*)		If specified to do incremental search AND search preview,
*)		reset the original header caption

*   Scope:      Public
*   Parameters: None
*$  Usage:      
*$              
*   Returns:  Logical .T. by default
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	07/10/99 - KJM
*		MODIFIED    06/24/05 -NN added handling of backcolor/forecolor
******************************************************************
IF THIS.lInGridActive
	IF !THIS.lSeekMode AND THIS.lSearchPreview
		THIS.Parent.Header1.Caption = THIS.cHoldCaption
	ENDIF
ENDIF

*-- CHANGE - NN - June 24, 2005 - 15:38:56
*     MODIFIED  06/24/05 - NN used correct colors to show in the grid
this.BackColor = this.nBackColor
this.ForeColor = this.nForeColor
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