I’m working on a custom listbox / grid and I’m using graphic StringWidth() to wrap the text in cells. I’ve circled the issues I’m having in red. The first issue ( top-left ) I believe is caused by only one word on the first line, which is to long for the cell width. I think I can easily work around that. The second issue (lower-right). The method doesn’t seem to be wrapping correctly after the word “There”. I would have expected the next word or two after “There” to be added to the line before wrapping occurred.
Is this normal behavior for StringWidth() or should I be looking at my code a little closer?
The data for the listbox is coming from an Sqlite (Chinook.db) database. I used Sqlite Expert to enter some extra text and it must have added some line endings. I copied the text from the database into notepad and removed the line endings. Then used Valentina Studio to re-enter the text and now it displays correctly. Other data from the database seems to wrap correctly.