ListBox项目可以跨多行吗? C#

我想让ListBox控件包含跨越多行的项目。

基本上我想要的是每个项目跨越多行并可作为一个项目选择。 有没有办法做到这一点?

正如LarsTech在他的评论中所建议的LarsTech ,所有其他评论都会导致某种完全编码的例子,这可能会使您LarsTech困惑。 我用几行代码制作了这个演示程序,供您遵循并轻松入门:

  listBox1.DrawMode = DrawMode.OwnerDrawVariable; //First add some items to your listBox1.Items //MeasureItem event handler for your ListBox private void listBox1_MeasureItem(object sender, MeasureItemEventArgs e) { if (e.Index == 2) e.ItemHeight = 50;//Set the Height of the item at index 2 to 50 } //DrawItem event handler for your ListBox private void listBox1_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); e.Graphics.DrawString(listBox1.Items[e.Index].ToString(), e.Font, new SolidBrush(e.ForeColor), e.Bounds); } 

在此处输入图像描述