EditWindow Property

Returns a handle to the grid's editing window, or 0 if the grid is not in edit mode.

Syntax

val& = [form!]VSFlexGrid.EditWindow

Remarks

You can use this property to determine whether the grid is in edit mode. If the grid is in edit mode, EditWindow returns the window handle of the currently active text box or drop-down combo. If the grid is not in edit mode, EditWindow returns zero.

For example, the following code prevents the user from scrolling the grid while a cell is being edited:

Private Sub fg_BeforeScroll(ByVal OldTopRow As Long, ByVal OldLeftCol As Long, ByVal NewTopRow As Long, ByVal NewLeftCol As Long, Cancel As Boolean)

     If fg.EditWindow <> 0 And OldTopRow <> NewTopRow Then

     Cancel = True

     End If

End Sub

Data Type

Long

See Also

VSFlexGrid Control