Dockable Windows - OnClose Event?

Dockable Windows - OnClose Event?

MattH_Work
Collaborator Collaborator
1,006 Views
5 Replies
Message 1 of 6

Dockable Windows - OnClose Event?

MattH_Work
Collaborator
Collaborator

I can successfully create a dockable window (browser), which then displays my user form correctly using similar code to this

 

Dim oUserInterfaceMgr As UserInterfaceManager
oUserInterfaceMgr = m_inventorApplication.UserInterfaceManager
oWindow = Nothing
Try
oWindow = oUserInterfaceMgr.DockableWindows.Add(m_ClientId, "String1", "String2")
Catch
oWindow = oUserInterfaceMgr.DockableWindows.Item("String1")
End Try
oWindow.AddChild(oForm.Handle)
oWindow.DisabledDockingStates = DockingStateEnum.kDockTop + DockingStateEnum.kDockBottom
oWindow.DockingState = DockingStateEnum.kDockLeft
oWindow.SetMinimumSize(oWindow_Height, oWindow_Width)
oWindow.Visible = True

 

However, if I close the dockable window in Inventor and reopen it, it still displays the form with its current settings, rather than the original base form. The form seems to be still open, even if the window is not

How do I send a signal to my form to fully close when the user clicks the dockable windows 'X' button?

2018-12-06_09h05_10.png

In essence, is there an onclose event for dockable windows

 

Regards

 

MattH

 


MattH
Product Design Collection 2026
Vault Pro 2026
0 Likes
1,007 Views
5 Replies
Replies (5)
Message 2 of 6

YuhanZhang
Autodesk
Autodesk

You can use the OnHide event in this case.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 6

MattH_Work
Collaborator
Collaborator

What would be the simplest way to implement an OnHide event for a dockable window


MattH
Product Design Collection 2026
Vault Pro 2026
0 Likes
Message 4 of 6

YuhanZhang
Autodesk
Autodesk

In UI when you click the 'x' button it just hides the dockable window/browser but not close/delete it, when you click the '+' button you can see a dropdown list and choose one browser/dockable window to display will make it visible. So you can see the API side exposes the DockableWindowsEvents.OnHide/OnShow events for the behavior. And I attached a simple VBA sample to demonstrate how to use them, you can load the IVB and run the DockableWinShowHideSample function, and then show/hide the dockable windows to see the  events are fired.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 5 of 6

MattH_Work
Collaborator
Collaborator

The ZIP file seems to be emtpy


MattH
Product Design Collection 2026
Vault Pro 2026
0 Likes
Message 6 of 6

YuhanZhang
Autodesk
Autodesk

Re-attached it, please check it.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes