Hi,
As you can see in the below code, I’m trying to draw a rectangle in the cell. It works well, and no problem to see the rectangle and the row value.
The problem is that I don’t see other column values in Listbox.
Without implementing ‘rectangle feature’, I see the all column values populated in Listbox correctly.
It has taken me several hours, but I can’t find the bug.
Can you check this code?
PopulateListbox
While Not rs.EOF
dataList.AddRow("")
For i As Integer = 1 To dataList.ColumnCount - 1
dataList.Cell(dataList.LastIndex, i) = rs.IdxField(i).StringValue
If i = 7 Then 'PRINCE status
Dim p as New Picture(100,40,32)
p.Graphics.ForeColor = &C92B92C
p.Graphics.FillRect(0,0,100,40)
p.Transparent=1
dataList.CellTag(dataList.LastIndex,i) = p
End If
Next
rs.MoveNext
Wend
Datalist.Refresh
CellTextPaint
[code] g.ForeColor = &c647D84
If column = 7 Then
dim p as Picture = me.CellTag( row,column )
g.DrawPicture p,0,0
g.DrawString me.cell(row,column),x,y
End If
Return true
[/code]