Hi
In visual studio, why dont you create a usercontrol instead (as it has no borders), add all of your controls into that and add it into the dockable window?
This is how i have done it:
Imports System.Runtime.InteropServices
Imports System
Imports System.Type
Imports System.Activator
Imports Microsoft.VisualBasic
Imports Inventor
Imports System.IO
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Module DockWindow
Public oWindow As Inventor.DockableWindow
Public IsBrowserVisible As Boolean = True
Public DockHeight As Long = 500
Public dockWidth As Long = 350
Public DockShown As Boolean = False
Private InitialDockHeight As Long = 0
Private InitialDockWidth As Long = 0
Public InAction As Boolean = False
Private addInCLSIDString As String
Private dc As Test01
Public Sub SetDockableWindow(addInCLS As String)
Dim oUserInterfaceMgr As Inventor.UserInterfaceManager = AddinGlobal.InventorApp.UserInterfaceManager
Try
oWindow = oUserInterfaceMgr.DockableWindows.Add(addInCLS, "AutoSheetDockWindow", "Auto Sheets")
oWindow.AddChild(CreateChildDialog())
oWindow.DisabledDockingStates = DockingStateEnum.kDockTop + DockingStateEnum.kDockBottom
oWindow.Visible = False 'Dont show the window on loading. Set to True to show on startup
Catch ex As Exception
End Try
End Sub
Public Function CreateChildDialog() As Long
If Not dc Is Nothing Then
dc.Dispose()
dc = Nothing
End If
dc = New Test01()
dc.Show(New WindowWrapper(AddinGlobal.InventorApp.MainFrameHWND))
Return dc.Handle.ToInt64()
End Function
Public Sub DockVis(visible As Boolean)
Dim oUserInterfaceMgr As Inventor.UserInterfaceManager = AddinGlobal.InventorApp.UserInterfaceManager
Select Case visible
Case True
oUserInterfaceMgr.ShowBrowser = False
oWindow.Visible = visible
Select Case DockShown
Case False
oWindow.DockingState = DockingStateEnum.kDockLeft
oWindow.SetMinimumSize(DockHeight, dockWidth)
DockShown = True
End Select
Case False
oWindow.Visible = visible
oUserInterfaceMgr.ShowBrowser = IsBrowserVisible
End Select
End Sub
End Module
Note:
you can add a form in the exact same way, just declare dc as the form instead. Set your form to have no borders and turn off the buttons in the forms properties

This code shows the dock bar when a button is clicked and closes it when its i click a close button. Here is the button code in the ButtonActions Class
'Namespace autosheet
Public Class ButtonActions
Public Shared Sub Button1_Execute()
'TODO: add code below for the button click callback.
Dim oUserInterfaceMgr As Inventor.UserInterfaceManager = AddinGlobal.InventorApp.UserInterfaceManager
Select Case InAction
Case True
Exit Sub
Case False
DockWindow.IsBrowserVisible = oUserInterfaceMgr.ShowBrowser
DockWindow.DockVis(True)
oUserInterfaceMgr = Nothing
DockWindow.InAction = True
End Select
End Sub
End Class
in my close button, i use this:
DockWindow.InAction = False
DockWindow.DockVis(False)
I turn off the main browser to only have mine there during usage. it is turned off here:

It also docks the window to the left. this can be changed in this line of code:
It is controlled by the 'Visible As Boolean' in the above sub
hope that helps
Nacho
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

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.