PRB: When Event Fires Again Upon Leaving a Grid Column (148408)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
This article was previously published under Q148408 SYMPTOMS
If there is only one column enabled in a grid and you try to use SetFocus
to move the focus programmatically to another object such as a command
button, the focus moves to the command button correctly but the grid also
moves the active grid cell to highlight the next available cell. Because
there is only one active column, there is no "next available cell," so the
cell that's activated ends up being the same that fired the When event, so
the When event of that column fires again.
RESOLUTION
There are a number of workarounds for this situation:
- Add a small dummy column to the grid so that the focus can move off the
original cell that implemented the When event onto the dummy column.
-or-
- Set the SelectedOnEntry property to False so that the effect is less
noticeable.
-or-
- If the problem is that the When event fires when you manually try to
move to another object in the VALID, check for movement key presses such
as TAB or ENTER in the KeyPress method of the column, and substitute
with CTRL+TAB, which will prevent the attempt to move the pointer to the
next column.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 9/30/2003 |
---|
Keywords: | KB148408 |
---|
|