I'm having a little problem with the datagrid.
If you start going up the datagrid from the bottom of the grid, the
tooltips will be off by one row (the same thing doesn't seem to be
happening when you start from the top of the grid). Since the tooltips
are off, it means that the setting of RowMark and ColumnMark (global
variables) are also off by one row, which results in our right-click menus
using the wrong cell.
Any ideas?
Allan
Here is the mouse move event (I don't think that RowContaining is
returning the right row, even):
Private Sub dbgResultsPane_MouseMove(Button As Integer, Shift As Integer,
_
X As Single, Y As Single)
Dim Row As Long, col As Long
On Error Resume Next
Row = dbgResultsPane.RowContaining(Y)
col = dbgResultsPane.ColContaining(X)
If Row >= 0 And col >= 0 Then
dbgResultsPane.ToolTipText = dbgResultsPane.Columns(col).CellValue _
(dbgResultsPane.RowBookmark(Row))
Else
dbgResultsPane.ToolTipText = ""
End If
RowMark = Row
ColumnMark = col
End Sub
Here is mousedown, for the same grid:
Private Sub dbgResultsPane_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
If Button = 2 Then ' right-click
If Not gridRs.EOF Then
If ColumnMark <> -1 And RowMark > -1 Then
If Not IsNull(dbgResultsPane.Columns(ColumnMark).CellValue _
(dbgResultsPane.RowBookmark(RowMark))) Then
Call ShowCxtMenu(Button, BUCKET_ELEVATOR)
End If
End If
End If
End If
End Sub
Thanks in Advance,
Allan