DataGrid and ToolTip 
Author Message
 DataGrid and ToolTip

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?


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.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,

Tue, 14 Sep 2004 06:17:12 GMT  
 [ 1 post ] 

 Relevant Pages 

1. DataGrid and ToolTip

2. Datagrid questsions (combobox tooltip, header link, resize combo-rectangle)

3. Implement a tooltip with a datagrid

4. Datagrid tooltip for record field

5. Need some help with DataGrids (DataGrid-->DataGrid, DataGrid-->Dataset, DataGrid-->XML)

6. How do I set the Datagrid row to be same size as the datagrid window

7. Using datagrid as datasource for another datagrid

8. Datagrids inside a Datagrid

9. Copy from Datagrid to datagrid

10. Updating datagrid with requery, datagrid goes to top

11. Tooltip turning off

12. ToolTip in MenuBar


Powered by phpBB® Forum Software