Re: msflexgrid - detecting mouse click beyond last row

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



> In cases where my grid does not include enough rows to fill the
control
> area, I want to detect when a mouse click (in this case a right click)
was
> in the blank space below the last grid row.
>
> I had assumed that the MouseRow property would be invalid in this
instance
> but it isn't. It seems to contain the highest valid row number even
though
> my click point is well below the last row in the control.
>
> Any suggestions?

Put this code...

If y > MSFlexGrid1.RowPos(MSFlexGrid1.Rows - 1) + _
MSFlexGrid1.RowHeight(MSFlexGrid1.Rows - 1) Then
MsgBox "You clicked below the grid"
End If

in either the MouseUp or MouseDown event for the MSFlexGrid (depending
on when you want to trap the mouse button action).

Rick


.


Quantcast