In the beginning, I have a 4-form desktop program that wants to display every form on a screen depending on a unique identifier for this screen, for example Form 1 on the screen with ID etc and Form 2 on the screen with the ID ....
If all form is run correctly, i need a Way to check whether the screens are connected throughout the program life cycle so that if disconnect one, get a message in the name of the form in which it was displayed and prevent this form from moving to another screen
I tried the following method:
Screen.ALLScreen []
However, this method does not provide an ID depending on the screen, but depending on the sequence of screen connections to the computer.
private void Form1_Load(object sender, EventArgs e)
{
Form2 F2= new Form2();
Form3 F3 = new Form3();
this.Location = new Point(Screen.AllScreens[0].Bounds.X, Screen.AllScreens[0].Bounds.Y);
F2.Location = new Point(Screen.AllScreens[1].Bounds.X, Screen.AllScreens[1].Bounds.Y);
F3.Location = new Point(Screen.AllScreens[2].Bounds.X, Screen.AllScreens[2].Bounds.Y);
F2.Show();
F3.Show();}
//here i will check all screens if they are connected throughout the program life cycle
public void checkScreen(){`// rescan all screen`check if there any screen disconnected`if it happened `send message form name and close the form or minmize it`}