views:

180

answers:

4

How do you minimise a window programmatically when using windows wpf? I can seem to find a .resize attribute?

+4  A: 

You are looking for the Window.WindowState property. It is a dependancy property and when changed will set the Window.RestoreBounds property , so you can always restore to the size before the change.

See the enumeration here.

myWindow.WindowState = WindowState.Minimized;
Oded
+1  A: 

set WindowState = WindowState.Minimized;

sean e
thanks i couldnt come across this xd
Erika
+1  A: 

this.WindowState = WindowState.Minimized;

Veer
A: 
YourWindowName.WindowState = WindowState.Minimized;
Johnny