ListBox怎么设置每项的高度?
ListBox怎么设置每项的高度?
2011-06-26 02:35
程序代码: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;
}
}
2011-06-26 08:22
2011-06-26 12:07