Markus_13
Markus_13

Reputation: 328

Single item with linebreak in tListBox

So question is how to make items for tListBox with a linebreak inside of them (so every item should contain 2 rows). I found how to alter the item height, but still cant get it to divide an item text by linebreaks. Is it possible without hooking the whole rendering process? Maybe some WinApi native solutions??

Upvotes: 2

Views: 484

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 595320

Is it possible without hooking the whole rendering process?

No. A standard ListBox control does not support line breaks. You have to owner-draw the ListBox items (set the Style property to one of the lbOwnerDraw... styles, and assign an OnDrawItem event handler) to draw each item however you want. You can use the Win32 DrawText() function to draw text that contains line breaks.

Upvotes: 1

Related Questions