Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SelectOnEntry and TextBox::GotFocus
Message
De
15/05/2005 04:32:40
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01014284
Message ID:
01014329
Vues:
25
This message has been marked as the solution to the initial question of the thread.
>With VFP8 the code below works perfect. When I click on text? he is selected.
>
>But with VFP9 when I click with mouse on textbox? he is not selected.
>
>I don't understand where is my mistake.
>

This code calls TextBox::Gotfocus 2 times;
before VFP9 a bug arrested the sequence of the events,
therefore MouseDown, MouseUp, Click did not happen and the SelectOnEntry remained applied.
On VFP9 the bug is killed and then MouseDown, MouseUp are executed.
The solution is simple:
To arrest the sequence with NODEFAULT.

>
PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>DEFINE CLASS form1 AS form
>
>
>	Top = 0
>	Left = 0
>	Height = 123
>	Width = 319
>	DoCreate = .T.
>	Caption = "Form1"
>	Name = "Form1"
>
>
>	ADD OBJECT text1 AS textbox WITH ;
>		Alignment = 3, ;
>		Value = 0.00, ;
>		Height = 25, ;
>		Left = 34, ;
>		SelectOnEntry = .T., ;
>		Top = 27, ;
>		Width = 81, ;
>		Name = "Text1"
>
>
>	ADD OBJECT text2 AS textbox WITH ;
>		Alignment = 3, ;
>		Value = 0.00, ;
>		Height = 25, ;
>		Left = 163, ;
>		SelectOnEntry = .T., ;
>		Top = 27, ;
>		Width = 81, ;
>		Name = "Text2"
>
>
>	PROCEDURE text1.GotFocus
           if m.this.SelectOnEntry
		TextBox::GotFocus
                NODEFAULT
           endif
>	ENDPROC
>
>
>	PROCEDURE text2.GotFocus
>		TextBox::GotFocus
                NODEFAULT
>	ENDPROC
>
>
>ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform