diff --git a/VPet-Simulator.Windows/Function/MWController.cs b/VPet-Simulator.Windows/Function/MWController.cs index b5850cc..4cebeeb 100644 --- a/VPet-Simulator.Windows/Function/MWController.cs +++ b/VPet-Simulator.Windows/Function/MWController.cs @@ -16,6 +16,13 @@ namespace VPet_Simulator.Windows this.mw = mw; _isPrimaryScreen = mw.Set.MoveAreaDefault; _screenBorder = mw.Set.MoveArea; + + // control position inside bounds + double dist; + if ((dist = GetWindowsDistanceLeft()) < 0) mw.Left -= dist; + if ((dist = GetWindowsDistanceRight()) < 0) mw.Left += dist; + if ((dist = GetWindowsDistanceUp()) < 0) mw.Top -= dist; + if ((dist = GetWindowsDistanceDown()) < 0) mw.Top += dist; } private Rectangle _screenBorder;