BIM World
A Professional BIM Learning Platform


Revit Secondary Development: How to Keep Windows Always on Top of Revit

During development, a common issue arises when working with plugin windows. After opening the plugin window, switching to other applications, covering Revit, and then returning to Revit, the plugin window often disappears, giving the impression that it has crashed. To prevent this, it is essential to bind the plugin window to the main application window. This can be achieved by adding two lines of code before calling ShowDialog():

System.Windows.Interop.WindowInteropHelper mainUI = new System.Windows.Interop.WindowInteropHelper(view);
mainUI.Owner = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
view.ShowDialog();
xuebim
Follow the latest BIM developments in the architecture industry, explore innovative building technologies, and discover cutting-edge industry insights.
← Scan with WeChat
Like(0) 打赏
BIM WORLD » Revit Secondary Development: How to Keep Windows Always on Top of Revit

Comment Get first!

Must log in before commenting!

 

BIM World, A Professional BIM Learning Platform

Stay updated on the latest architecture trends and share new building technologies.

Contact UsAbout Us

觉得文章有用就打赏一下小编吧

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

Account Login

By signing in, you agree toUser Agreement

Sign Up