ComboBox ItemHeight 再高一点

 1         public static void BindData(this ComboBox box, List<KeyValuePair<long, string>> data)
 2         {
 3             box.ItemHeight = 18;
 4             box.DropDownStyle = ComboBoxStyle.DropDownList;
 5             box.DrawMode = DrawMode.OwnerDrawFixed;
 6             box.DataSource = data;
 7             box.DrawItem += (sender, e) =>
 8             {
 9                 if (e.Index < 0)
10                 {
11                     return;
12                 }
13                 e.DrawBackground();
14                 e.DrawFocusRectangle();
15                 e.Graphics.DrawString(data[e.Index].Value.ToString(), e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y + 3);
16             };
17         }
原文地址:https://www.cnblogs.com/jonney-wang/p/7891817.html