简体   繁体   中英

C# wrap text inside a 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- 在此输入图像描述

Below is my output 在此输入图像描述

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));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM