devxlogo

Limit the Focus of an MSFlexGrid to a Certain Range of Columns and Rows

Limit the Focus of an MSFlexGrid to a Certain Range of Columns and Rows

This code limits the focus in a big MSFlexGrid to a certain range of columns and rows. It limits movement by using the entercell method. It controls the use of enterkey, arrowkey, or mouse clicking with simple, on-cell direct editing:

Const XTRA_COLS = 3     'including fixed columnConst XTRA_ROWS = 15    'including fixed rowPrivate Sub flxGrdDemo_EnterCell()    With flxGrdDemo        If .Col > .Cols - XTRA_COLS Then            .Col = 1            If .Row + 1  "" Then _                .Text = Mid(.Text, 1, Len(.Text) - 1)        End With    Case Is 

devx-admin

Share the Post: