I don't think that this is possible by Visio itself. We have implemented the
following method "ToFront". Hope this is what you are looking for.
Best regards,
Markus
using System.Runtime.InteropServices;
[DllImport("User32",EntryPoint="SetForegroundWindow")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
public void ToFront()
{
IntPtr _handle;
_handle = (IntPtr) visioApplication.WindowHandle;
SetForegroundWindow( _handle );
}
Mats-Lennart Hansson said:
Ok, maybe I'm a bit unclear. I'll try to explain it again:
In Visio, I have a toolbar button that opens up a non-modal window form in
front of Visio. This form contains references to the Visio document (pages
and shapes). When I click on each reference I want the Visio document to set
the active page and zoom into the actual shape (this works). But I also want
to focus the Visio window. Since the form is non-modal the user can, and
will, use other applications during runtime so I can't assume that just
hiding the form will bring focus to the Visio window. In other words, is
there a way to set focus on a Visio window using any of the standard objects
Document, Application or Page?
Thanks,
Mats-Lennart
to
paragraph.