Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Focus
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Re: Focus
Miscellaneous
Thread ID:
00815251
Message ID:
00816093
Views:
18
>I didn´t get it Gerry. Maybe i did not explain myself very clear. I need to know if one of the lines in a grid object is select or not. I triggered the DELETE key to delete the current record, but nothing should happen if the cursor would be focusing any other object on the form. Only when i click on the grid that the procedure triggered by ON KEY LABEL DEL must delete the cursor record and refresh the grid. I found a way by using GETFOCUS and LOSTFOCUS of the TEXT1 object of each colunm by setting a flag each time any of the colunms got the focus. Is there an easy way to do that.

PMFJI, just wanted to mention another idea commonly used, for such things in grids, and is generally less-confusing to users, IMO. Something like this, maybe customized to your specific needs:

Put a checkbox in table/view/cursor grid column 1 for "delete". The header caption for checkbox column can say something like "Delete?" The rest is up to you what to do, I use a command button just beneath grid (I formerly used a key too, and if users are accustomed to it, that's fine).

The command button can say something like "Remove Deleted Records" or just "Refresh List" is more generic and might do several tasks at once (again, entirely up to you, whta else is going on, and what your users will understand best). An aditional advantage is that users can back out of a deletion by unchecking the checkbox, and it's very clear what is going on to a user.

A large number of my grids have checkbox in column 1, for various actions aside from delete. Users love the checkboxes, so they can see exactly what's going on, and that's the main consideration above all.

But the other point here is that you don't need to do nearly as much work trying to track where the focus is if you have that checkbox in your grid, the tracking is not needed, particularly if you have a command button for the records to be deleted (and then you get the grid refresh automatically, of course). If you use OKL for the deletes, still it's not too hard to do since the record(s) for deletion have a flag on them.

Just another way of doing it, as usually there are many ways...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform