Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to find out the control focus is jumping to?
Message
From
17/12/2008 15:31:09
 
 
To
17/12/2008 14:45:41
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01368256
Message ID:
01368296
Views:
14
>>Hi,
>>
>>In the LostFocus event of a TextBox, I plan to code actions depend on the next control who is receiving focus.
>>
>>Something like:
>>
>>If <control receving focus is control A or contrl B> then
>>   do nothing
>>else
>>   populate a listbox with values
>>endif
>>
>>
>>I am aware that if control A's when event returns .F. then the jump of focus to it will fail, but in my case I am not interested in what will be the outcome of the focus switch, I just need to know where the focus is heading...
>>
>>Is there a way I can find out which control VFP is attempting to set focus to?
>
>Are you sure that LostFocus is a good place? Please, note that user may just imitate the same behavior by using mouse and you may not like populating listbox in this case. Would not be more consistent to populate listbox in the same place where you issue setfocus to that control?

Hi,
I am aware of 3 ways where a focus might leave a textbox, the tabs, accelerate key and mouse click.
Please see my reply to Borislav Borissov, I think in this case, the different of puting codes in LostFocus and GetFocus is depednig of which scenario I am facing:
1) Exclude all but include few - meaning I need to only populate the listbox if focus is jumping to few controls out of many in a form
2) Exclude few but include all - meaning I want to always populate the listbox except for few controls out of many in a form
Previous
Reply
Map
View

Click here to load this message in the networking platform