Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling focus
Message
From
16/12/2005 18:22:23
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01078835
Message ID:
01078853
Views:
11
Sergey -
Thanks for the tip. The article makes sense and helped me cleanup the code somewhat but I still cannot return focus to the textbox after the forms method runs. I have tried placing thisform.textbox1.setfocus in the form method and this still works when the method is called by the button but not when it is called by the textbox.

Any more thoughts?

btw - I'll be out after today, so have a great holiday!


>See http://fox.wikis.com/wc.dll?Wiki~MethodsShouldNeverCallEvents
>
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform