不好修改,自己写一个combobox吧,我这有一个,可惜东西太多,发不上来

解决方案 »

  1.   

    当ComboBox的DrawMode设置为非Normal的时候,它的高度是由ItemHeight来决定的,
    但是这个时候可能ComboBox的Items要求重绘.
      

  2.   

    楼主可以试试:
    comboBox1.DrawMode=OwnerDrawVariable;
    comboBox1.ItemHeight=50;看看是不是高度变高了.
      

  3.   

    对于重绘,可以参考如下的代码:
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Windows.Forms;
    using System.Drawing;namespace TestApp
    {
    class combox:ComboBox
    {
    public combox()
    {
    this.DrawMode = DrawMode.OwnerDrawVariable;
    this.ItemHeight = 60;
    }
    protected override void OnMeasureItem(MeasureItemEventArgs e)
    {
    e.ItemHeight = 20;
    e.ItemWidth = 200;
    base.OnMeasureItem(e);
    }
    protected override void OnDrawItem(DrawItemEventArgs e)
    {
    base.OnDrawItem(e);
    using (SolidBrush brush = new SolidBrush(e.ForeColor), backBrush=new SolidBrush(e.BackColor))
    {
    e.Graphics.FillRectangle(backBrush, e.Bounds);
    e.Graphics.DrawString(this.Items[e.Index].ToString(), this.Font, brush, e.Bounds);
    }
    }
    }
    }