Share your ideas for improving. Vote on ideas and discuss them with the MYOB product development team.

Product Ideas

Display: Detect missing screen

Experienced Partner

17Posts

2Kudos

0Solutions

17 Posts
Experienced Partner

If you use MYOB on a laptop, and at work have multiple screens but at home just have the laptop screen, MYOB will re-open on the screen that is no longer attached to your computer.

 

You then need to click click, move, use you keyboard to move the window back into view.

 

This is an easy fix:

 

public void loadLastState() {

// variables
bool bLocationVisible = false;

// behave differently if the window was full screen or not last time
if (Properties.Settings.Default.windowIsFullScreen) {

// the window was full screen when it was last closed, just do that
this.WindowState = FormWindowState.Maximized;

} else {

// get the last location
System.Drawing.Point ptLocation = Properties.Settings.Default.windowLocation;

// if it hasn't been set, both X and Y values will be 0, exit
if (ptLocation.X == 0 && ptLocation.Y == 0) { return; }

// Check the point is still on one of our screens
foreach (Screen s in Screen.AllScreens) {
if (s.Bounds.Contains(ptLocation)) { bLocationVisible = true; }
}

// If the point is one on of our screens, proceed with setting location and size
if (bLocationVisible) {
this.StartPosition = FormStartPosition.Manual;
this.Location = ptLocation;
this.Size = Properties.Settings.Default.windowSize;
}

}

}

Current Status: Archived
Last Changed: August 2018

Thank you for the idea. Unfortunately, this request has had no support from the community since it was submitted, so we are moving this idea to the Archived status. For more information on Idea Statuses, please read this article: Changes to our Idea Exchange pages

1 Comment
Steven_M
45,180 Posts
Former Staff

Thank you for the idea. Unfortunately, this request has had no support from the community since it was submitted, so we are moving this idea to the Archived status. For more information on Idea Statuses, please read this article: Changes to our Idea Exchange pages