你好社區,是否有可能設置高度小於21個像素的System.Windows.Forms.Combobox-控制
我有一個問題與System.Windows.Forms的高度。組合框 - 控制。我無法改變它。我想用它來編寫自己的實現(所有者繪製自定義控件)。
以下代碼不適用於我(僅限於嘗試)。高度仍然是21px!
public class TestBox : ComboBox
{
public TestBox()
{
DropDownHeight = 15;
}
protected override Size DefaultSize
{
get
{
return new Size(15,15);
}
}
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
{
base.SetBoundsCore(x, y, 15, 15, specified);
}
}
請幫幫我。
Regars, 馬科
你使用的minimumSize? – serhio 2010-02-12 14:38:29
好吧,thx爲我沒有設置我即是我的例子。但它不起作用! – 70sCommander 2010-02-12 14:49:39
製作自己的組合如何? – Luiscencio 2010-02-12 15:16:13