Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error 2012 Cannot set focus...
Message
 
À
30/04/2004 10:59:27
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00899782
Message ID:
00899819
Vues:
18
Hi Calvin,

You cannot call SetFocus() from Valid()/When().
Move source code from Valid() to LostFocus().

MartinJ

>This one is driving me nuts, because I know there is a solution but I cannot remember it. I have the following code in the Valid for a drop down list box. It works very well unless the user clicks in the edit box behind the list box. When that happens the .setfocus command causes an error 2012. How can you tell if the user exits a list box by using a mouse click elsewhere? Is there any way to prevent this error. Thanks!
>
>this.Visible=.f.
>thisform.LockScreen=.t.
>WITH this.Parent.eb1
> holdstart=.selstart
> newlen=holdstart+LEN(TRIM(letterstuff.descript))+5
> .value=SUBSTR(.value,1,.selstart)+'<<'+TRIM(letterstuff.descript)+'>> '+SUBSTR (.value,.selstart+1)
> .refresh()
> thisform.LockScreen=.f.
> .selstart=newlen
> .setfocus()
>ENDWITH
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform