Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# wrap text inside a listbox

Tags:

c#

listbox

I want to display a list of words in a listbox, wrapped them together. Below is an example what I want to do. I was able to add words to listbox with a comma and in one line. Can you please help me to wrap this text.

For comma separation I used, ListBox.Items.Add(string.Join(",", myList));

Expected output- enter image description here

Below is my outputenter image description here

like image 516
Buddhi Avatar asked Oct 20 '25 13:10

Buddhi


1 Answers

I do not think its possible to print multiple text lines per ListBox item with the standard ListBox. Try using a TextBox instead, with Multiline = true

  this.textBox1.Text = string.Join(",", UniqueWord(myList));
like image 127
Sajeetharan Avatar answered Oct 23 '25 15:10

Sajeetharan