I have a single-column listbox that I’m loading with about 10000 rows containing variable-length strings. When this data loads in the running program the text is truncated (with an ellipsis) about 1/3 of the width of the column. If I resize the window the column also resizes but the text stays at about 1/3 of the column width.
I’ve seen various threads here that talk about using CellTextPaint to assert the size of the text, but that seems like a complicated way to do this. Can anyone tell me what decides the truncation width of cell text and how I could override it? I can’t see anything in the Inspector or in the documentation.
Do you have the width of the column as */% or a fixed width? If its fixed, it wont “expand” when the control gets wider. See DesktopListBox — Xojo documentation for more information
That is very similar to what I see. I tried setting the column width to * and also to 100%, but it changes nothing. This is what I see. It seems very strange to me because I expected that a listbox would try to fill its width with the content and only use an ellipsis if the content is wider than the column. I suppose the second part is happening, but why not the first?
Yes, I tried all of those options, and did not use fixed width. It actually does bring more text into view when I increase the window width, but it’s always about 1/3 of the available space.
Thanks Julian, you have pointed me to the solution. I discovered a bit of legacy code from an earlier program (the perils of Save As) where the column widths were specified as “ColumnWidths = ‘35%, 35%, 30%’”. There is just one column, but it was being set faithfully at 35%.
Thanks for the useful comments. What a great forum.