Please, could you explain me how to resize a Rhino plugin Window ?
It is on the UserControl that we must work or on the Rhino.UI.Panel ?
I have tried these statements but with no success :
Public Class usrctl_frmInput
Private Sub ChangeWinSize()
Dim bDispAfterRedim As Boolean = Me.ResizeRedraw
Me.ResizeRedraw = True
Me.Width = 316
Me.Height = 127
Me.AutoScaleDimensions = New System.Drawing.Size(316, 127)
Me.Size = New System.Drawing.Size(316, 127)
Me.AutoScaleDimensions = New System.Drawing.Size(768, 374)
Me.Size = New System.Drawing.Size(768, 374)
Is it better to put some statements in the Rhino.PlugIns.PlugIn herited class ?
But which statements ?
Public Class ModelPlugIn
Public Sub ShowDockbar()
If Not Rhino.UI.Panels.IsPanelVisible(usrctl_frmInput.BarID) Then
dale knows this better for sure - but my 2 cents are:
put the statements in the Plugins Class,
i do it in c#, but its the same basically:
UserControl1 mycontrol = (Usercontrol1)Rhino.UI.Panels.GetPanel(typeof(UserControl1).GUID);
once you have the handle you can say things like: mycontrol.width = 250 etc.
Thank you, but it doesn't work.
What are you trying to do?
Your user control is buried inside of a couple of other windows, and these windows provide automatic resizing based on what else the tab is docked with and where the tab is docked. So providing plug-in control over resizing might not be possible.
Again, let me know what you are trying to do and why.
Sorry for my answer's delay !
Here is an example, in attachment, of what I would like to do.
When I run the following plugin in Rhino, using the command "ResizePlugInWindow", I've got the following interface (It's just an example) :
So, first, I would like to have it directly like this :
Then, when I run the program using the button "Use files !", as the interface it too big, I hide the input controls to have only the output controls, and so, I would like that the window reduces automatically, like this :
And, when the program is finished, I show again the input controls, and I would like that the window maximizes automatically, like this :
Do you know if it is possible ?
Thank you very much !
By choosing to use a tabbed dock bar to host your user control, you essentially loose the ability to control the size of the parent window. Like I mentioned, your user control is buried inside of a couple of other windows.
If you need control over the size of the window, then you should probably create a modeless Windows form instead of using a docking container.