ListBox怎么设置每项的高度?
ListBox怎么设置每项的高度?
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; } }