Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This.setfocus not setting focus
Message
From
19/01/2000 08:49:31
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
This.setfocus not setting focus
Miscellaneous
Thread ID:
00319809
Message ID:
00319809
Views:
53
Hello there,
I have a listbox on my form, and when the user types something, and presses return, I want that value to be entered into a listbox, and then keep the focus on the textbox to potentially enter more data. Here is my code from the textbox's keypress event.

LPARAMETERS nKeyCode, nShiftAltCtrl
if nKeyCode = 13
this.parent.command1.click()
this.setfocus
endif

The line this.parent.command1.click() properly fires that buttons click event which is what enters the textbox's value into the listbox. However, this.setfocus doesn't return the focus back to the textbox (remember, this code is from my textbox.keypress event). The focus, instead, remains on the command1, whose click event is fired by this code. Any idea of why it performs this way, and how I can get the focus where I want it?
Paul A. Busbey
Victoria Insurance
Next
Reply
Map
View

Click here to load this message in the networking platform