ListBox怎么设置每项的高度?
ListBox怎么设置每项的高度?
2.代码如下:
程序代码:
private void listBox1_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); e.DrawFocusRectangle(); e.Graphics.DrawString(listBox1.Items[e.Index].ToString(), e.Font, new SolidBrush(Color.Red), e.Bounds); } private void listBox1_MeasureItem(object sender, MeasureItemEventArgs e) { //要设置的宽度列 if (e.Index == 2) { e.ItemHeight = 50; } }