Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error 2012 Cannot set focus...
Message
 
To
30/04/2004 10:59:27
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00899782
Message ID:
00899819
Views:
19
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform