.NET Set inventor focus problem

.NET Set inventor focus problem

matt_jlt
Collaborator Collaborator
370 Views
1 Reply
Message 1 of 2

.NET Set inventor focus problem

matt_jlt
Collaborator
Collaborator

I have an addin that calls up a form using the below code

 

 

            Dim iptForm As New iptForm
            iptForm .Show(New WindowWrapper(ThisApplication.MainFrameHWND))

 On the form I have a button that executes the command manager "Pick" method. The problem I am having is that when I click the button, it runs the "Pick" command, but focus stays on the form which means to be able to select something I have to click on the inventor window to activate / set focus on it then click again to select.

 

I have looked around and found other examples of the same problem but no solutions have been posted and I just can't work out how to fix it. Could someone please help me out?

 

I am running: Inventor 2012 : Windows 7 64 bit : Addin is compiled as .Net 3.5

 

Old Post:

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Inventor-loses-focus/m-p/2438058/highl...

 

 

Thanks, Matt.

 

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

Mike.Wohletz
Collaborator
Collaborator

I have had this same problem and the way that I fixed it was to save my form information and close it when the pick command is started and as soon as you are done with this you show the form again and restore any data you had. I am sure that a better solution is available somewhere. 

 

0 Likes