PRB: When Event Fires Again Upon Leaving a Grid ColumnID: Q148408 3.00 3.00b WINDOWS kbtool kbprb The information in this article applies to:
SYMPTOMSIf 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.
RESOLUTIONThere are a number of workarounds for this situation:
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior1. Create a new form. Place a grid (Grid1) and a command button (Command1) 2. Set the following properties of the Grid:
3. Place the following code in the When event for Grid1.Column2.Text1:
4. Add the following code to the Valid method Grid1.Column2.Text1:
5. Run the form, and press TAB from within the grid. The focus moves to
6. To remedy the problem, add the following code to the KeyPress method for
Additional reference words: 3.00 3.00b VFoxWin
KBCategory: kbtool kbprb
KBSubcategory: FxtoolFormdes
|
Last Reviewed: March 15, 1996 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |