I have 3 monitors connection. I would like to cover up the entire 3 screens with the form and I would like to show the panel just in the center of the primary screen. How should I do this?
Right now I've covered up every screen with this code.
int form_width = 0;
int form_height = 0;
int form_x = 0;
int form_y = 0;
int sub_screen_width = 0;
int sub_screen_height = 0;
bool minus_x = false;
bool minus_y = false;
foreach (Screen screen in Screen.AllScreens)
{
form_width += screen.Bounds.Width;
form_height += screen.Bounds.Height;
if (form_x > screen.Bounds.X)
{
minus_x = true;
form_x = screen.Bounds.X;
}
if (form_y > screen.Bounds.Y)
{
minus_y = true;
form_y = screen.Bounds.Y;
}
if (screen.Bounds.X < 0)
sub_screen_width += screen.Bounds.Width;
if (screen.Bounds.Y < 0)
sub_screen_height += screen.Bounds.Height;
}
this.Width = form_width;
this.Height = form_height;
this.CenterToScreen();
this.Location = new Point(form_x, form_y);
What should I do for the panel??