I have been using a listbox with multiline text in RealStudio for a while, but its challenge has been that whilst you can display text in a multiline format, eg using the cellTextPaint event, you weren’t able to edit cleanly in a multiline format since the cell text is a textField, and the text goes beyond the edge of the field, so you have to scroll back and forth horizontally.
Now along comes Xojo and I note a listbox.typeEditableTextArea has been added to the column types. Hurray I thought, I’ll be able to edit multiline text in a nice wrapping textArea. And you can, its great. But you can not longer display that text in a wrapping format. It now all goes off the end after the three dots…
Not sure if this is a bug or an undocumented feature, but does anyone have a solution. Effectively I’d like to turn on the multiline property within the listbox text area so that I can both view and edit text in a multiline wrapping edit box.
[quote=9934:@James Pitchford]I have been using a listbox with multiline text in RealStudio for a while, but its challenge has been that whilst you can display text in a multiline format, eg using the cellTextPaint event, you weren’t able to edit cleanly in a multiline format since the cell text is a textField, and the text goes beyond the edge of the field, so you have to scroll back and forth horizontally.
Now along comes Xojo and I note a listbox.typeEditableTextArea has been added to the column types. Hurray I thought, I’ll be able to edit multiline text in a nice wrapping textArea. And you can, its great. But you can not longer display that text in a wrapping format. It now all goes off the end after the three dots…
Not sure if this is a bug or an undocumented feature, but does anyone have a solution. Effectively I’d like to turn on the multiline property within the listbox text area so that I can both view and edit text in a multiline wrapping edit box.
Jim[/quote]
I don’t see the problem… The Just keep drawing wrapped text in CellTextPaint as you did before… once the overlayed text area disappears celltextpaint is called to repaint the cell…
Hmmm I’m pretty sure the listbox USED to use a textarea for editing if you specified it (at least when specified by cell)…
In any case, with some effort, it is possible to move an external textArea over a cell for editing… That is what did in my listbox subclass to handle editing merged cells.
As mentioned above listbox row height normally can not be changed only for single row. However it is possible to sort of merge cells to effectively make a row a multiple of the set row height. That is what my listbox subclass does:
thanks for the keys to the solution.
in my viewpoint, you have to use a combination of replacelineending and encoding so that textarea and files work together.
regards
Dim arr() As String = Split(Me.Cell(row, column), EndOfLine)
For i As Integer = 0 To ubound(arr)
g.DrawString(arr(i), x, y - g.TextHeight + i * g.TextHeight)
Next
Return True
This code is for 3 line cell, first line will write at top, second line at middle and third line at bottom.
Note: this is not the best code and should be changed to your needs.