How do bring a WPF Window to front? -


I have created a single-instance application and if the user starts the app multiple times then the already opened window will be active It works fine, but I have a problem, if the previously opened window is beyond the second application window, then I should have brought it front.

I have tried the window. Focus () and window.Show () but both of them do not work as an alternative solution ...

  bool oldTopMost = window Top most; window. Most = true; Window. Most = oldtemmost; Window.Focus ();  

... this works but I look very ugly. Is there a better solution for this?

You can use instead:

  window.Activate ();  

This is WPF equivalent to call.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -