Message 1 of 1
There is an issue with setting the size when creating a dock panel using PaletteSet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I first declared a PaletteSet, set the Visible property, set the Dock property, and set the size, but the overall size of the interface did not change, only the internal size changed.
The following are the effect pictures of whether to change the size
The code is below
[CommandMethod("CreatePalette")]
public void CreatePalette()
{
// 初始化面板集对象
Autodesk.AutoCAD.Windows.PaletteSet ps = new Autodesk.AutoCAD.Windows.PaletteSet(" ");
Tab01 tab01 = new Tab01();
// 添加控件到面板集中
ps.AddVisual("My Tab01", tab01);
// 显示面板
ps.Visible = true;
ps.KeepFocus = true;
ps.Dock = Autodesk.AutoCAD.Windows.DockSides.Top;
ps.MinimumSize = new Size(ps.Size.Width, 30);
ps.DeviceIndependentMinimumSize = new Size(ps.Size.Width, 30);
ps.Size = new Size(ps.Size.Width, 30);
ps.DeviceIndependentSize = new System.Windows.Size(ps.Size.Width, 30);
// 设置面板样式和透明度
ps.Style = PaletteSetStyles.NameEditable |
PaletteSetStyles.ShowPropertiesMenu |
PaletteSetStyles.ShowAutoHideButton |
PaletteSetStyles.Snappable |
PaletteSetStyles.SingleRowDock |
PaletteSetStyles.ShowAutoHideButton |
PaletteSetStyles.ShowCloseButton;
ps.Opacity = 100;
}