Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: MessageBox and Application Losing Focus Issue

$
0
0
From what I understand, you are using 2 Windows (1 as main and the other as a child with owner property set to mainWindow).
When MessageBox's Yes button is clicked, the window child should close and set focus back to window main.
Have you tried the following when MessageBox returns a "Yes" :
 if( result == MessageBoxResult.Yes )
      {
        if( windowChild != null )
        {
          windowChild .Owner.Focus();
          windowChild .Close();
        }
      }
It should put the focus on the parent of the window child : the Window main.

You could also not use the property Owner on the window child.

You could also try to use a WindowContainer from the toolkit. You will be able to add ChildWindows or MessageBoxes in it. But no "Owner" property will be available for the childWindows.

Viewing all articles
Browse latest Browse all 2157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>