public class HyqCombox
{
public static void cbxItemHeight(ComboBox list, int itemHeight)
{
list.DropDownStyle = ComboBoxStyle.DropDownList;
list.ItemHeight = itemHeight;
list.DrawMode = DrawMode.OwnerDrawFixed;
list.DrawItem += new DrawItemEventHandler(delegate(object sender, DrawItemEventArgs e)
{
if (e.Index < 0)
{
return;
}
e.DrawBackground();
e.DrawFocusRectangle();
e.Graphics.DrawString(list.Items[e.Index].ToString(), e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y + 3);
});
}
}