Textarea in a listbox

I want to display a string of text in a cell of a listbox. I cannot get this to work, it displays on line of the text with … after. I have changed celltypeat to texture and no change?

Add an event handler to the listbox for the “CellTextPaint” event, and then you can draw the cells text at the x,y parameter passed in.

Eg

dim s as string

//ensure row and column are valid have text, etc

s = me.CellValueAt(row,column)

if s = "" then return false

//Draw text wrapped to fit within the column
g.DrawText(s,x,y,g.Width - x,false)

return true 

You will NOT get any …'ing here which is a lot more tricky

Graham, Thank you that is a great help. I am actually populating several cells within a one row table, will this still work? is the text paint triggered for every cell and so x,y, are right?

Graham, I’ve done it thank you so much. Works exactly as I wanted, thank you!!

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.