0

I'm using VS 2010, WPF 4, C#

I have a parent window and some child windows. When I minimize the parent window all child windows go minimize too. And when I maximize the parent window all child windows go maximize too but I want to restore the child windows in their previous position. How I can do this?

// This code snippet is in parent window

ChildWindow1 objChildWindow1 = new ChildWindow1();
-------
-------
objChildWindow1.Owner = this;
objChildWindow2.Owner = this;
objChildWindow3.Owner = this;

private void buttonShow_Click(object sender, RoutedEventArgs e)
{ 
 objChildWindow1.Show();
 objChildWindow2.Show();
 objChildWindow3.Show();
}

1) Now consider I've minimize ChildWindow1 and ChildWindow2 only. ChildWindow3 is still maximized.
2) Now if I minimized the parent window all three ChildWindow will be minimized and it's ok.
3) Now if I maximize the parent window all three ChildWindow is also maximized but I want ChildWindow1 and ChildWindow2 will be minimized and ChildWindow3 will be maximized.
How can I do this? Any other Idea?

Towhid
  • 1,920
  • 3
  • 36
  • 57
  • This is not default behavior in WPF, an owned window does *not* change its window state when the owner is maximized. Look for code in your project that you (or a team member) wrote to implement this behavior. – Hans Passant Jun 17 '11 at 12:22
  • I just write `objChildWindow.Owner = this` in the parent window. `WindowState` property for parent window is set `Maximized` and `Normal` the parent window and child window respectively. – Towhid Jun 17 '11 at 12:35

0 Answers0