Hello everyone,
I'm making the transition from ArcObjects over to ArcGIS Pro SDK (C#). I'm enjoying the learning experience so far, but I've hit a snag with a feature I'm trying to implement. Once a tool within my Pro dockpane's listbox has been executed, I want it to open a Windows Form center screen and stay in front of the ArcGIS Pro application at all times while the form is open (i.e. the form doesn't disappear behind the application if the user navigates back to their open map).
So far, I have the following code working fine when the form is launched:
gui_tool_polygon_overlaps tool_gui_polygon_overlaps = new gui_tool_polygon_overlaps();
tool_gui_polygon_overlaps.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
tool_gui_polygon_overlaps.Show();
However, I can't seem to locate the piece of code needed to keep the pop-up form in front of Pro.
In ArcObjects, I would use this:
gui_tool_polygon_overlaps tool_gui_polygon_overlaps = new gui_tool_polygon_overlaps();
tool_gui_polygon_overlaps.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
tool_gui_polygon_overlaps.Show(Control.FromHandle((IntPtr)ArcMap.Application.hWnd));
Can anyone tell me what the Pro SDK equivalent of...
Control.FromHandle((IntPtr)ArcMap.Application.hWnd)
...would be? Or is there a new, improved way to accomplish this task that I may be overlooking?
I was attempting to test the ".Owner" property of the form as well, but was struggling to figure out what to set it to specifically (if that's even the right course of action here).
Thanks for any insight!