Minimize a window in WPF?

后端 未结 7 1324
借酒劲吻你
借酒劲吻你 2020-12-08 12:53

How do you minimize a window programmatically when using windows WPF? I can seem to find a .Resize attribute?

7条回答
  •  旧时难觅i
    2020-12-08 13:32

    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;
    

提交回复
热议问题