Community
Here is my code for a dockable window. I attached a small example of a dockable window addin that reads and writes iproperties in parts / assemblies / sub parts and assemblies and drawings on the fly.
My only problem is that i cant get the TAB button to work.
tab works when the child dialog is created with "Showdialog" but then inventor freezes.
what am i doing wrong?
please help me - somebody.
regards kent boettger.
Public Sub CreateDockableWindow(app As Inventor.Application, addInCLS As String) Dim uiMgr As UserInterfaceManager = app.UserInterfaceManager Dim myDockableWindow As DockableWindow = uiMgr.DockableWindows.Add(addInCLS, "MyWindow", "My Add-in Dock") myDockableWindow.AddChild(CreateChildDialog()) If Not myDockableWindow.IsCustomized Then myDockableWindow.DockingState = DockingStateEnum.kFloat myDockableWindow.Move(25, 25, myDockableWindow.Height, myDockableWindow.Width) End If End Sub Public Function CreateChildDialog() As Long If Not dc Is Nothing Then dc.Dispose() dc = Nothing End If dc = New Form1() 'Addin works but no Tab? dc.Show(New WindowWrapper(m_invApp.MainFrameHWND)) 'Tab works here but inventor freezes 'dc.ShowDialog(New WindowWrapper(m_invApp.MainFrameHWND)) Return dc.Handle.ToInt64() End Function
Solved! Go to Solution.
Solved by kbo. Go to Solution.
in case someone is struggling with the same problem.
Here is how i solved this.
Private Sub TapPressed() If Me.txtPartNumber.Focused = True Then Me.txtDescription1.Focus() ElseIf Me.txtDescription1.Focused = True Then Me.txtDescription2.Focus() ElseIf Me.txtDescription2.Focused = True Then Me.txtDesignationGB.Focus() ElseIf Me.txtDesignationGB.Focused = True Then Me.txtDesignationDE.Focus() ElseIf Me.txtDesignationDE.Focused = True Then Me.txtAxRohdim.Focus() ElseIf Me.txtAxRohdim.Focused = True Then Me.txtType.Focus() ElseIf Me.txtType.Focused Then txtOverallDim.Focus() ElseIf Me.txtOverallDim.Focused = True Then Me.txtRoh.Focus() ElseIf Me.txtRoh.Focused = True Then Me.txtOrderNo.Focus() ElseIf Me.txtOrderNo.Focused = True Then Me.txtCustomer.Focus() End If End Sub Private Sub iPropsfrm_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If e.KeyCode = Keys.Escape Then 'MsgBox("Pressed ESC") 'get rid of the annoying ding sound e.SuppressKeyPress = True End If If e.KeyCode = Keys.Tab Then 'get rid of the annoying ding sound e.SuppressKeyPress = True TapPressed() 'MsgBox("Pressed TAB") End If End Sub