1

Is there a way to only allow window resize to happen from the minimize and maximize buttons? Prevent the user from hovering over the window edges and dragging to resize.

Update

What I have so far is I grab the default size on load and store them.

In Window_SizeChanged event I reset the size to what is stored. It does still Maximize. The issue with this is you can still grab the edges and attempt to resize but it creates chopping black space but does return to original size.

Tsukasa
  • 6,342
  • 16
  • 64
  • 96
  • I managed to do something with SizeChanged event but still not perfect. Updated OP. – Tsukasa Dec 13 '13 at 03:51
  • You can add `MaxHeight` and `MaxWidth` as well – trinaldi Dec 13 '13 at 03:57
  • @GrantWinney, please undelete your answer and edit it to clearly outline the solution to this problem. Tsukasa, please accept GrantWinney's answer when he edits it, so that other users will know that this question has an accepted answer, as is customary on this website. – Sheridan Dec 13 '13 at 09:40

1 Answers1

2

Using ResizeMode="CanMinimize" in the opening <Window...> tag will get you pretty close to what you want. It allows minimizing and prevents the user from resizing the window, but unfortunately it disables maximizing.

If you really need that functionality, here's a previous SO post with a workaround you can try:

Enable Maximize, Minimize and Restore Window in WPF (Manual Resize is disable)

Community
  • 1
  • 1
Grant Winney
  • 65,241
  • 13
  • 115
  • 165