DragMove 最大化后是不允许拖动的,解决办法在最大化WindowState改为Normal,并设置窗口大小和位置Private Sub MouseLefDown(ByVal sender as Object, ByVal e as System.Windows.Input.MouseButtonEventArgs) 'TODO: Add event handler implementation here. If e.LeftButton =System.Windows.Input.MouseButtonState.Pressed Then If Me.WindowState = WindowState.Maximized Then Me.WindowState = WindowState.Normal Me.Width = SystemParameters.WorkArea.Width Me.Height = SystemParameters.WorkArea.Height Window.Left = 0 Window.Top = 0 WindowStartupLocation = Windows.WindowStartupLocation.Manual End If Me.DragMove End If End Sub
我试了下尺寸大小不要修改了
Private Sub MouseLefDown(ByVal sender as Object, ByVal e as System.Windows.Input.MouseButtonEventArgs) 'TODO: Add event handler implementation here. If e.LeftButton =System.Windows.Input.MouseButtonState.Pressed Then If Me.WindowState = WindowState.Maximized Then Me.WindowState = WindowState.Normal Window.Left = 0 Window.Top = 0 WindowStartupLocation = Windows.WindowStartupLocation.Manual End If Me.DragMove End If End Sub
'TODO: Add event handler implementation here.
If e.LeftButton =System.Windows.Input.MouseButtonState.Pressed Then
If Me.WindowState = WindowState.Maximized Then
Me.WindowState = WindowState.Normal
Me.Width = SystemParameters.WorkArea.Width
Me.Height = SystemParameters.WorkArea.Height
Window.Left = 0
Window.Top = 0
WindowStartupLocation = Windows.WindowStartupLocation.Manual End If
Me.DragMove
End If
End Sub
Private Sub MouseLefDown(ByVal sender as Object, ByVal e as System.Windows.Input.MouseButtonEventArgs)
'TODO: Add event handler implementation here.
If e.LeftButton =System.Windows.Input.MouseButtonState.Pressed Then
If Me.WindowState = WindowState.Maximized Then
Me.WindowState = WindowState.Normal
Window.Left = 0
Window.Top = 0
WindowStartupLocation = Windows.WindowStartupLocation.Manual
End If
Me.DragMove
End If
End Sub
{
//TODO: Add event handler implementation here.
if (e.LeftButton == System.Windows.Input.MouseButtonState.Pressed) {
if (this.WindowState == WindowState.Maximized) {
this.WindowState = WindowState.Normal;
Window.Left = 0;
Window.Top = 0;
WindowStartupLocation = System.Windows.WindowStartupLocation.Manual;
}
this.DragMove();
}
}