下拉大小设置不采取

问题描述:

用下面的代码.....下拉大小设置不采取

ToolStripControlHost treeViewHost; 
    ToolStripDropDown dropDown; 
    public MyTreeViewCombo() 
    { 
     TreeView treeView = new TreeView(); 
     treeView.BorderStyle = BorderStyle.None; 
     treeViewHost = new ToolStripControlHost(treeView); 
     // create drop down and add it 
     dropDown = new ToolStripDropDown(); 
     dropDown.Items.Add(treeViewHost); 
    } 
    public TreeView TreeView 
    { 
     get { return treeViewHost.Control as TreeView; } 
    } 
    private void ShowDropDown() 
    { 
     if (dropDown != null) 
     { 
      dropDown.Height = DropDownHeight; 
      dropDown.Width = DropDownWidth; 
      treeViewHost.Width = DropDownWidth; 
      treeViewHost.Height = DropDownHeight; 
      dropDown.Show(this, 0, this.Height); 
     } 
    } 
    [...] 

不管是什么dropDownHeight设置为,它只会显示一个小下拉(高度不发生变化)。

任何想法为什么会发生这种情况?

+0

你可以看看在Firebug中生成的HTML什么的?也许你有一个CSS规则埋在某个地方? – kaveman 2012-04-27 19:20:03

+0

这是.NET胖客户/赢的形式。 – ort11 2012-04-27 19:24:42

+0

愚蠢的评论,我很抱歉... – kaveman 2012-04-27 19:25:08

检查是否有其他财产阻止它。也许AutoSize属性设置为true