Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select the text With VFP9 doesn't work
Message
De
26/04/2005 06:21:28
Bruno Maddalozzo
Informatica Aziendale
Arsie, Italie
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Select the text With VFP9 doesn't work
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Divers
Thread ID:
01008374
Message ID:
01008374
Vues:
63
I've the need to select the entire text (in some texts) when clicking with the mouse.
I used to put the following code in the GotFocus event:
This.SelStart = 0
This.SelLength = 255
This.SetFocus

This doesn't work any more in VFP9 (it worked with VFP8).
In the bottom I've put the code to reproduce the behaviour.
When clicking from text1 to text2 the content of text2 is not selected.
I realized, with a slow computer, that the text is first selected, but immediatedly looses the selection.
The selection is kept when clicking with the right button of the mouse.

Any ideas to let the text selected with the left-click?


TIA.
Bruno
Public oForm
oForm = CreateObject("form1")
oForm.Show()
*


DEFINE CLASS form1 AS form
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT text1 AS textbox WITH ;
		Height = 25, ;
		Left = 60, ;
		Top = 60, ;
		Width = 97, ;
		Name = "Text1"


	ADD OBJECT text2 AS textbox WITH ;
		Alignment = 3, ;
		Value = 123.45, ;
		Height = 25, ;
		Left = 60, ;
		Top = 108, ;
		Width = 97, ;
		Name = "Text2"


	PROCEDURE text2.GotFocus
		This.SelStart = 0
		This.SelLength = 255
		This.SetFocus
	ENDPROC


EndDefine
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform