Multiple monitors: How can I tell if a windows form is being displayed on a disconnected screen?
Posted on 2014-04-02
I have a vb.net windows form app that remembers the .top and .left properties of some of its forms and then sets them each time the program is run.
The program is now run on a SurfacePro tablet which is docked to a Targus SuperSpeed USB 3 station and uses DisplayLink to drive 2 external 24" monitors in addition to the tablet's touch screen.
The program's forms are positioned on the external monitors and everything works well until the tablet is undocked and reverts to a single screen system. When the app is run, it still displays its forms on the disconnected monitors instead of the primary screen.
How do you programmatically (vb) determine if a windows form is being displayed on a monitor that is not connected (or visible)?