B4J Question ToolTipText for B4XTable

Mikelgiles

Active Member
Licensed User
Longtime User
When hovering over a B4XTable cell or header I would like to show a ToolTipText with information based on the row and column when hovering over a cell and just the column when hovering over the header. If this is possible where can I find help on how to do it?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
1.
B4X:
B4XTable1.MaximumRowsPerPage = 20
B4XTable1.BuildLayoutsCache(B4XTable1.MaximumRowsPerPage)

2.
B4X:
Sub B4XTable1_DataUpdated
    For i = 0 To B4XTable1.VisibleRowIds.Size - 1
        Dim pnl As B4XView = NameColumn.CellsLayouts.Get(i + 1) '0 = header
        Dim lbl As Label = pnl.GetView(NameColumn.LabelIndex)
        SetMouseNotTransparent(lbl)
        Dim RowId As Long = B4XTable1.VisibleRowIds.Get(i)
        If RowId = 0 Then
            lbl.TooltipText = ""
        Else
            Dim row As Map = B4XTable1.GetRow(RowId)
            Dim value As String = row.Get(NameColumn.Id)
            lbl.TooltipText = value
        End If
    Next
End Sub

Private Sub SetMouseNotTransparent (lbl As B4XView)
    #if B4J
    Dim jo = lbl As JavaObject
    jo.RunMethod("setMouseTransparent", Array(False))
    #End If
End Sub
 
Upvote 0
Top