C# WPF SizeChanged event doesn't update width and height when maximized

前端 未结 1 1595
一个人的身影
一个人的身影 2021-01-06 01:58

I was trying to update my controls when the size of the form changed using SizeChanged.

It worked perfectly, except when going full screen.

I s

相关标签:
1条回答
  • 2021-01-06 02:46

    I was able to receive SizeChanged event on maximize:

    private void window1_SizeChanged(object sender, SizeChangedEventArgs e)
    {
        var a = window1.ActualHeight;
        var b = window1.ActualWidth;
        var c = window1.Height;
        var d = window1.Width;
    }
    

    And these are values for window Height and Width:

    a = 838.4
    b = 1550.4
    c = 350.4
    d = 524.8

    0 讨论(0)
提交回复
热议问题