Unable to expand WPF window sequentially

I have a minimized WPF window. I click an item in the taskbar to maximize. It sounds a little, and I try again and again. Usually about the third attempt it will be maximized. What could make him abandon my initial attempt to maximize?

+3
source share
2 answers

One possibility is that you have code that changes the value of the ResizeMode property to NoResize.

See this page for more details: http://msdn.microsoft.com/en-us/library/ms748948.aspx

Secondly, you can override OnStateChanged and not call base.OnStateChanged () sequentially.

-, -, . - , - , WPF / .

+3

. , ...

this.SizeToContent = System.Windows.SizeToContent.Manual;
this.MaxWidth = double.PositiveInfinity;
this.MaxHeight = double.PositiveInfinity;
this.Width = double.NaN;
this.Height = double.NaN;
this.WindowState = WindowState.Maximized;

'this' .

0

Source: https://habr.com/ru/post/1792311/


All Articles