unkwntech

Stuff

Apr 18th, 2014
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.20 KB | None | 0 0
  1. public void DisplayScreens()
  2.         {
  3.             Panel p;
  4.  
  5.             int w = 0, h = 0, i = 0, offset;
  6.  
  7.             //Debug.WriteLine(Screen.AllScreens.Length);
  8.  
  9.             Width = 350;
  10.  
  11.             foreach (Screen s in Screen.AllScreens)
  12.             {
  13.                 offset = i*10;
  14.  
  15.                 //Debug.WriteLine((s.Bounds.Width / 10) + offset);
  16.  
  17.                 p = new Panel
  18.                 {
  19.                     Location = new Point((s.Bounds.X / 10) + offset + (screenArea.Width / 2), (s.Bounds.Y / 10)),
  20.                     Name = "panel",
  21.                     Size = new Size((s.Bounds.Width / 10), (s.Bounds.Height / 10)),
  22.                     TabIndex = 0,
  23.                     BackColor = Color.Black,
  24.                     BorderStyle = BorderStyle.Fixed3D,
  25.                 };
  26.  
  27.                 Width += (p.Size.Width + 10);
  28.                 screenArea.Size = new Size(Width - 350, screenArea.Size.Height);
  29.  
  30.                 //Debug.WriteLine(p.Size);
  31.                 //Debug.WriteLine(p.Location);
  32.  
  33.                 screenArea.Controls.Add(p);
  34.  
  35.                 panels.Add(p);
  36.  
  37.                 i++;
  38.             }
  39.  
  40.             //Height = h;
  41.             //Width = w;
  42.         }
Advertisement
Add Comment
Please, Sign In to add comment