Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

How To Add a UserControl Or Userform to a DockableWindow in Inventor?

bradeneuropeArthur
Mentor

How To Add a UserControl Or Userform to a DockableWindow in Inventor?

bradeneuropeArthur
Mentor
Mentor

How To Add a UserControl Or Userform to a DockableWindow in Inventor?

I have this sample but i would like to add labels; textboxes; etc to the Dockablewindow.

 

Dim oUserInterfaceMgr As UserInterfaceManager
        oUserInterfaceMgr = ThisApplication.UserInterfaceManager

        ' Create a new dockable window
        Dim oWindow As DockableWindow
        oWindow = oUserInterfaceMgr.DockableWindows.Add("SampleClientId", "TestWindowInternalName", "Test Window")

        ' Get the hwnd of the dialog to be added as a child
        ' CHANGE THIS VALUE!
        Dim hwnd As Long
        hwnd = 4851096

        ' Add the dialog as a child to the dockable window
        oWindow.AddChild(hwnd) Her I would like to add a UserControl or Userfrom!!!!!

        ' Don't allow docking to top and bottom
        oWindow.DisabledDockingStates = DockingStateEnum.kDockTop And DockingStateEnum.kDockBottom

        ' Make the window visible
        oWindow.Visible = True

Does anyone have a sample for this?

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes
Reply
Accepted solutions (3)
3,239 Views
27 Replies
Replies (27)

marcin_otreba
Contributor
Contributor
Accepted solution

sorry, i tried to recreate described behavior but without success. it never occur in my projects.

0 Likes

bradeneuropeArthur
Mentor
Mentor

Could you please send me a screenshot of the Form Settings you use?

For me the Userform is for 0.5  sec visible in the left of the screen, then it moves to the dockable window.

It is to quick to send a screenshot.

 

Thanks,

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

marcin_otręba
Advisor
Advisor

sorry, i do not know what do you want ? screenshot of form in inventor or from vb ?

when finally you add dockable window?

0 Likes

bradeneuropeArthur
Mentor
Mentor

Hi,

Sorry for my bad explanation....

I would like to have a screenshot of the properties in Vb.net, if possible.

I think I have solved it by minimizing the userform before adding it to the DockableWindow!

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

marcin_otręba
Advisor
Advisor

marcin_otręba
Advisor
Advisor

And ?did it help ? i uploaded simple addin project for dockable windows - one with form, second with control. I nnoticed your situation with missing content, it is not due to scaling, it is when form is not added to dockable window.

0 Likes

bradeneuropeArthur
Mentor
Mentor

Hi,

 

So you are seeing this behavior too?

Need to take a look at your share.

Thank you for that in advance!

Regards

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

Well It does that if you build the form in VBA istedt of Globle form

0 Likes