can I add an VBA form into a dockeble windows?

can I add an VBA form into a dockeble windows?

Darkforce_the_ilogic_guy
Advisor Advisor
516 Views
3 Replies
Message 1 of 4

can I add an VBA form into a dockeble windows?

Darkforce_the_ilogic_guy
Advisor
Advisor

can I add an VBA form into a dockeble windows? I have this form in VBA 

bt_0-1636575408139.png

 

I would like to get it to dock ...I know it is possible to make an form in ilogic .. that create a windows  that can dock .. I would like my form to dock as  well like any other things in inventor .. how do I do this ?  I have this code in iloigc that might help .. but I need the form Ktool into an windows and it need to be an VBA form .. 

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
0 Likes
517 Views
3 Replies
Replies (3)
Message 2 of 4

JelteDeJong
Mentor
Mentor

I expect that you can. The help files even have a VBA example.

 

Edit:

Sorry didn't read correctly I assume you found the help file already.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 4

Darkforce_the_ilogic_guy
Advisor
Advisor

I have seen that code before but I do not know have to add my form to the windows

0 Likes
Message 4 of 4

Ralf_Krieg
Advisor
Advisor

Hello

 

It is possible. The problem is, a VBA form doesn't have a hwnd property by default. Take a look at the last post in this thread.

https://forums.autodesk.com/t5/inventor-ilogic-api-vba-forum/add-in-dockable-window/td-p/7107964


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes