PRB: Grid Does Not Respond to the Click or Dblclick Events (128075)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
This article was previously published under Q128075 SYMPTOMS
The methods associated with the Click or DblClick events of a grid are not
executed when a user clicks any element of the Grid. It seems events are
not triggered when the grid is filled with data.
CAUSE
This behavior is by design. A grid object is a container of columns.
Columns in turn contain controls. Methods defined in a container are not
inherited in the container hierarchy. For example, the code you include in
the Click event of a form is not executed when you click a command button.
When a grid is filled with data and you click a cell in the grid, the
control, a text box by default, receives the Click event. The grid receives
the click event in areas that contain no data.
WORKAROUND
Use the Click event procedure of the control to trap for a mouse click in a
filled record.
Another way to trap for a mouse click anywhere on the grid is to cover the
grid with a shape, and place code in the Click event of the shape. Make
sure the Backstyle property of the shape is set to 0 for transparent and
that the shape is on top. If the shape is not on top of the grid, you can
place it there by selecting "Bring to Front" on the layout toolbar when the
shape is selected.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 8/24/1999 |
---|
Keywords: | KB128075 |
---|
|