Width
在最大化窗口时,屏幕的属性似乎不会更新为完全最大化的宽度.如果我调整大小,一切正常,但不是最大化时.
我的代码如下:
private void Window_SizeChanged(object sender, SizeChangedEventArgs e) { UpdateColumns(); } private void button1_Click(object sender, RoutedEventArgs e) { UpdateColumns(); } private void UpdateColumns() { ColumnCount = Math.Round(Width/150); statusBarItemColumnCount.Content = ColumnCount; button1.Content = ColumnCount + " " + Width; } private void Window_StateChanged(object sender, EventArgs e) { UpdateColumns(); }
Dominic Hopt.. 15
看看ActualWidth
,而不是Width
.
看看ActualWidth
,而不是Width
.