Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus Doesn't Work
Message
 
To
20/05/2009 10:34:52
Robert Dinsmore
Dinsmore & Associates, Inc.
Lexington, Kentucky, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01400953
Message ID:
01401026
Views:
115
>A form designed for data entry contains a page frame and a grid on the first page listing the records in a file. The first column in the grid allows for incremental search based on the record key. Therefore, if the record pointer is on Number 1 and the user wishes to go to Number 3, they just press "3" and the record pointer jumps to that record. They can go to the details of that record (Page 1 on the form) by either pressing the Enter key or clicking on Page 1.
>
>Here is the problem: when the Enter key is pressed the form advances to Page 1 as it should. However, when they click on Save or Cancel and the form returns to the grid, Column 1 does not have the focus. At this point, if a key is pressed to search for another record, the cursor jumps out of the grid and to another object on the form.
>
>This only happens when the Enter key is used to advance to Page 1. If, instead, Page 1 is clicked and then Save or Cancel is clicked, the grid gets the focus as it should.
>
>This would indicate that there is something about the Enter key to cause this. Since the code works when the page is clicked, I would have to assume it is OK.
>
>After many hours I have not been able to solve this. Any ideas would be greatly appreciated.


In my forms, I use the grid's ActivateCell() method in addition to SetFocus(). Perhaps that might help.
Jon Rosenbaum
Devcon Drummer
Previous
Reply
Map
View

Click here to load this message in the networking platform