There is an issue with setting the size when creating a dock panel using PaletteSet.

There is an issue with setting the size when creating a dock panel using PaletteSet.

dali0312
Contributor Contributor
100 Views
0 Replies
Message 1 of 1

There is an issue with setting the size when creating a dock panel using PaletteSet.

dali0312
Contributor
Contributor

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

dali0312_0-1738898630297.png

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;
        }
0 Likes
101 Views
0 Replies
Replies (0)