【发布时间】:2011-04-24 08:51:45
【问题描述】:
我的应用程序在触摸屏上运行,它有一个透明的主窗口,所以调整大小的唯一方法是使用 grip,但在触摸屏上很难做到。我想知道是否有办法以编程方式增加大小。
我尝试过使用自定义命令,但窗口只增加了少量。这是我的命令的代码:
private const int sizeIncreaseThreshold = 50;
private double aspectRatio = 2.45;
private void IncreaseSizeExecuted(object sender, ExecutedRoutedEventArgs e)
{
this.Width = this.Width + sizeIncreaseThreshold * aspectRatio;
this.Height = this.Height + sizeIncreaseThreshold;
e.Handled = true;
}
【问题讨论】:
标签: wpf resize window resizegrip