Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling focus
Message
From
16/12/2005 17:19:31
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Controlling focus
Miscellaneous
Thread ID:
01078835
Message ID:
01078835
Views:
48
Problem:

A textbox contains code in its lostfocus event to click a button.
if lastkey()=13
thisform.cmdSearch.click()
endif
The click event of the button runs a procedure and returns focus to the textbox.
thisform.findrec()
thisform.donstextbox1.SetFocus()
This works properly when the button is clicked with the mouse but does not work when the click is called from the textbox. Instead of returning focus to the textbox, focus goes to the next control in the tab order.

I tried calling the button.click from textbox.valid but this produces an error that says a setfocus cannot be called from a valid.

Any suggestions?

Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform