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

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

bradeneuropeArthur
Mentor Mentor
3,805 Views
27 Replies
Message 1 of 28

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 & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Accepted solutions (3)
3,806 Views
27 Replies
Replies (27)
Message 21 of 28

marcin_otreba
Contributor
Contributor
Accepted solution

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

0 Likes
Message 22 of 28

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 & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 23 of 28

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?

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 24 of 28

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 & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 25 of 28

marcin_otręba
Advisor
Advisor

maybe this will helps somehow:

 

https://drive.google.com/open?id=1WNM6cVfhdex9IZce_9kwexiHxT21JUyR

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

Message 26 of 28

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.

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 27 of 28

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 & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 28 of 28

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

0 Likes