次のコードで.....
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が何に設定されていても、小さなドロップダウンのみが表示されます(高さは変更されません)。
なぜこれが起こっているのか考えはありますか?