Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get plugin UI to be at the same level as Revit?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
0001des
500 Views, 2 Replies

How to get plugin UI to be at the same level as Revit?

I'm currently setting my plug-in's UI to "TopMost" but if I minimize Revit, my plugin stays on top.  Is there a way to have my plug-in's UI to match the functionality of Revit?

2 REPLIES 2
Message 2 of 3
jeremytammik
in reply to: 0001des

You have to ensure that your control is assigned the Revit main window as parent.

 

For instance, if you display your form using ShowDialog, make use of its overload taking an IWin32Window argument:

 

  • ShowDialog(IWin32Window) -- Shows the form as a modal dialog box with the specified owner.

 

https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.form.showdialog?view=netframework-4...

 

https://thebuildingcoder.typepad.com/blog/2010/06/revit-parent-window.html

 

Also note that the Revit 2019 API provides direct access to the Revit main window handle:

 

https://thebuildingcoder.typepad.com/blog/2018/08/whats-new-in-the-revit-20191-api.html#3.1.4

 

Cheers,

 

Jeremy

 

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3
0001des
in reply to: jeremytammik

Thanks.  That worked.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community