control for size of Palette Set

control for size of Palette Set

a_saber_mt
Explorer Explorer
291 Views
5 Replies
Message 1 of 6

control for size of Palette Set

a_saber_mt
Explorer
Explorer

i create new Palette Set and use the blow codes to control the size in AutoCAD  but not pass if drag the pallet in AutoCAD there are gap

        _PaletteSet.Size = new Size(530, 680);
        _PaletteSet.Style = PaletteSetStyles.ShowAutoHideButton
              | PaletteSetStyles.ShowCloseButton
              | PaletteSetStyles.ShowPropertiesMenu | PaletteSetStyles.UsePaletteNameAsTitleForSingle
              | PaletteSetStyles.Snappable;
        _PaletteSet.DockEnabled = DockSides.Right | DockSides.Left;
        _PaletteSet.MinimumSize = new Size(530, 680);
        _PaletteSet.SetSize(new Size(530, 680));
        _PaletteSet.Visible = true;

 PALLET.png 

0 Likes
Accepted solutions (1)
292 Views
5 Replies
Replies (5)
Message 2 of 6

khodulieucuong
Participant
Participant

It seems you have declared fixed height and width for the user control inside. User d:DesignHeight and d:DesignWidth

0 Likes
Message 3 of 6

ActivistInvestor
Mentor
Mentor

Without seeing the properties that you are setting the UserControl to it's hard to guess what may be the issue, but you could also try setting the Visible property to true before you set the DockEnabled and MinimumSize properties and call SetSize().

0 Likes
Message 4 of 6

a_saber_mt
Explorer
Explorer

this the properties of UserControl 
p1.png

0 Likes
Message 5 of 6

ActivistInvestor
Mentor
Mentor
Accepted solution

It should be obvious but in case it isn't, you have MinimumSize and MaximumSize set to explicit values. They should be reset because the control is supposed to fill its parent's client rectangle, which it will do automatically if you don't set those properties. Also, I don't understand why you have Padding set. Lastly, the AutoSize property is false, it should be true.

 

ActivistInvestor_0-1758603096763.png

 

0 Likes
Message 6 of 6

a_saber_mt
Explorer
Explorer

thanks 

0 Likes