Change size of Panel window

Hi everyone,

I have a panel that opens in a new window. The point is this window has some default size that cuts off my content.

And I don’t see how to change the window size. I tried to set static width/height for my control, but it seems like panel window does not react to content size.

Does anybody know if there is a way to set an initial size for the panel window so content would be fully displayed?

I use RhinoCommon Rhino.UI.Panels class to show/hide the panel.

Thanks,
Julia

Hi @Yuliya,

What are you using for your panel class? Windows.Forms, WPF, or Eto?

The host panel container does not care about the panel size, it is a modeless, docking container and can be morphed into many shapes and sizes depending on where the user moves the panel. The best practice it to use a scrolling panel as your top level control.

– Dale

I know topic is old but think it relates to my question. Is there any way to set min width to panel ? lets say my ui overlaps at 150px and it doesn’t make sense to use it in that form so i want to have it always not less than for eg. 200px

Hi @D-W,

Because panels can be docked in other panel, and those other panels will be of differing sizes, its best to make the controls in you panel size correctly in all situations.

Or am I confused by your question?

– Dale

No i think you know what i mean but when i have 6 butons in horizontal alignment 3 are docked to left 3 to right when panel is @ 150px they starts to ovelap so i thought easiest way to prevent this would be setting min width. Anyway i think no matter what kind of panel options but for eg when panel is 50px wide theres no way to use there any option.

Hi @D-W,

Are you using Eto, WinForms, etc.?

– Dale

@dale WinForms with WPF host but i’m concidering now to switch to WPF entirely - I don’t use Eto cause i need to support v5 still.

Btw. is there any difference in handling wpf in rhino ?

Difference compared to WPF outside of Rhino? No.

– Dale

I’ve tried to set my winforms UserControl.AutoScroll to true but resizing still chops off the panel without displaying the scroll bar…
Any suggestions?
FYI I was following this GitHub - JackTing/SampleCsPanel: Sample C# RhinoCommon plug-in that demonstrates how to create a tabbed, docking panel.

Try adding your ui controls to a docked control container inside your user control. Something like a Panel / Flow Panel / Splitter should do the trick.

crux is the anchor property
when i set the panel to anchor on all sides of the user control, enabling an “autofill” effect, it broke the autoscroll

1 Like