.Net user control in dockable window

.Net user control in dockable window

nmunro
Collaborator Collaborator
748 Views
1 Reply
Message 1 of 2

.Net user control in dockable window

nmunro
Collaborator
Collaborator

Does anyone have a pointer to an example of using a user control in an Inventor dockable window. If I create an instance of my user control and use myDocableWindow.AddChild(<ctrl>.Handle), it acts as if the control is a dialog rather than a user control (i.e. myDocableWindow.Control returns null). I've searched high and low but there does not seem to be any examples of this out there.

 

Neil

        


https://c3mcad.com

0 Likes
749 Views
1 Reply
Reply (1)
Message 2 of 2

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

I believe you asked a relevant question through ADN a few days ago :-). I found the comment may be simlar for this question. i.e. The DockWindow.Control returns the control which is registered. When using AddChild(<control>.Handle), this just refers to the user control class. So, if you AddChild(GUID of the control), the DockWindow would remember the control. I verified it at my side.

 

'Call oWindow.AddChild(m_control.Handle)

Call oWindow.AddChild("{C75A15CF-DF21-3EB7-AADF-48441AA55CCD}")

 

' now, the control is NOT nothing

Dim oControl As Object = oWindow.Control
If Not oControl is Nothing then
     Dim oUserControl As UserControl = oControl  
     MessageBox.Show("control handle:" + oUserControl.Handle.ToString())
End If

 

Hope this helps. 

0 Likes