I create a AddIn that works with a dockable window. This dockable window has a usercontrol added into it. this user control is much smaller than the dockable window. Now I would like to match the size but the width property does not affect my window?
I changed my width from 50 to 40 to 20 and no visible difference. How am I supposed to change the window width?
Private DDCbrowser As DockableWindow
Private DDC As DocumentDisplayControls ' User Control class
Private Sub CreateDockableWindow()
' Set reference to the user interface manager
Dim oUserInterfaceMgr As UserInterfaceManager
oUserInterfaceMgr = m_inventorApplication.UserInterfaceManager
' Create a new dockable window
DDCbrowser = oUserInterfaceMgr.DockableWindows.Add("SampleClientId", "DDCIntName", "Ellimetal DDC")
DDC = New DocumentDisplayControls
DDCbrowser.AddChild(DDC.Handle)
' Dock the window to the right
DDCbrowser.DockingState = DockingStateEnum.kDockRight
' Show the title bar
DDCbrowser.ShowTitleBar = True
DDCbrowser.Width = 20
' Set the dockable window visible
DDCbrowser.Visible = True
End Sub
Please kudo if this post was helpfull Please accept as solution if your problem was solved
I have yet to do any work with Dockable windows myself, but the chap who wrote/created the "MyVaultBrowser" addin for Inventor* has provided the source code over on https://github.com:
Perhaps in there he has achieved the very answer you are looking for?
*In case you weren't aware, this addin first gets the Vault Addin instance and then separates the Vault browser window into a separate dockable window.
Property that gets and sets the current width of the window. Setting the width may fail in certain situations such as when the window is docked to the top or bottom and spans the entire width of the Inventor frame.
Syntax
DockableWindow.Width() As Long
Version
Introduced in Inventor version 2011
But my window is docked to the right..
' Dock the window to the right
DDCbrowser.DockingState = DockingStateEnum.kDockRight
It would be nice if Autodesk would respond to this thread.
Please kudo if this post was helpfull Please accept as solution if your problem was solved
I don't have aclue how I did it and if it's "fully docked"
I created a usercontrol and added it into my dockable window like this.
Private DDCbrowser As DockableWindow
Private DDC As DocumentDisplayControls
Private Sub CreateDockableWindow()
' Set reference to the user interface manager
Dim oUserInterfaceMgr As UserInterfaceManager
oUserInterfaceMgr = m_inventorApplication.UserInterfaceManager
' Create a new dockable window
DDCbrowser = oUserInterfaceMgr.DockableWindows.Add("SampleClientId", "DDCIntName", "Ellimetal DDC")
DDC = New DocumentDisplayControls
DDCbrowser.AddChild(DDC.Handle)
' Dock the window to the right
DDCbrowser.DockingState = DockingStateEnum.kDockRight
' Show the title bar
DDCbrowser.ShowTitleBar = True
DDCbrowser.Width = DDC.Width
' Set the dockable window visible
DDCbrowser.Visible = True
End Sub
Please kudo if this post was helpfull Please accept as solution if your problem was solved
Changing the Height/Width on runtime is the problem. It seems to work initially (later occasionally), but as far as I could see, the SetMinimiumSize method is only honored once, so you cannot respond on runtime, e.g. different MinSize fo Top/bottom as for the others....
Alltogether the DockableWindow-APi seems not to be implemented very well.....
For me the dockable window width is not set correctly, the window width differes from my input.
Private Sub CreateDockableWindow()
' Set reference to the user interface manager
Dim oUserInterfaceManager As UserInterfaceManager =
XpressTools.StandardAddInServer.m_inventorApplication.UserInterfaceManager
' Create a new dockable window
Browser = oUserInterfaceManager.DockableWindows.Add("XpressTools-DID-ID", "DIDintName", "XpressTools browser")
' Dock the window to the right
Browser.DockingState = DockingStateEnum.kDockRight
' Show the title bar
Browser.ShowTitleBar = True
' Set the dockable window visible
Browser.Visible = True
' Disable certain docking positions
Browser.DisabledDockingStates = DockingStateEnum.kDockBottom And DockingStateEnum.kDockBottom
' Set the window width
Browser.Width = 230
' Set the minumum size for the browser.
Browser.SetMinimumSize(300, 220)
' Add control to the dockable window
Browser.AddChild(Me.Handle)
End Sub
The minimum size is set indeed, but the dockable window size is more like 350 and is too large for me.
Please kudo if this post was helpfull Please accept as solution if your problem was solved