Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3804

PaintCellBackground

$
0
0

Hi group, I’m trying to do something at the limit of my possibilities :slight_smile: I inserted the color values ​​in the RowTag of a ListBox, which I should use to color the rows of the ListBox separately, line by line.
When I read the data I upload my values:

ListBoxEventi.RowTagAt(ListBoxEventi.LastRowIndex) = rows.Column("ColoreRigo").StringValue + "," + rows.Column("ColoreTesto").StringValue

Then I would like to take these values ​​and color the rows, both with the backcolor and text color. But I can’t … I don’t know what the problem is, I understood that the data is read not in loop but almost.

' RowTag of ROW
Var tag As String = ListBoxEventi.RowTagAt(row)

' IF RowTag is not NULL, separate my values
If tag <> "" Then
  Var colori() As String = tag.Split(",")
  
  ' BackGround color (ColoreRigo)
  If UBound(colori) >= 0 Then
    g.FillColor = Color.FromString(colori(0)) ' Colore di sfondo (ColoreRigo)
    g.FillRect(0, 0, Me.CellWidth(row, column), Me.CellHeight(row, column))
    
  End If
  
  ' TEXTCOLOR (ColoreTesto)
  If UBound(colori) >= 1 Then
    g.ForeColor = Color.FromString(colori(1)) ' Colore del testo (ColoreTesto)
  End If
End If

' DRWA TEXT IN CELL
g.DrawText(Me.Cell(row, column), 5, 5)

13 posts - 6 participants

Read full topic


Viewing all articles
Browse latest Browse all 3804

Trending Articles