title: Algorithm to Tile Window
body: <p>I've a Form with 2 buttons:</p>
  
  <ol>
  <li>Open a new Form, and put it in a List</li>
  <li>Tile the opened Form</li>
  </ol>
  
  <p>What I need to do now is to write an algorithm that maximizes the user screen occupied by forms. Obviously this would be simple, so I have some extra requirement:</p>
  
  <ol>
  <li>width / height ratio must be in a given interval, say [a,b]</li>
  <li>Window may be overlapped by V pixel "vertically" and H pixel "horizontally"</li>
  </ol>
  
  <p>Edit : since it seemed not clear, here's the code...</p>
  
  <pre><code>        public static List&lt;Form&gt; formlist = new List&lt;Form&gt;();
          ...
  
          private void button2_Click(object sender, EventArgs e)
          {
              Form f = new Form();
              f.Text = "Title";
              ...
              formlist.Add(f);
              f.Show();
           }
  
          private void button3_Click(object sender, EventArgs e)
          {
               foreach(Form f in formlist)
               {
                      f.Width =  *** opt width ***;
                      f.Height = *** opt height ***;
                      f.SetDesktopLocation( ***opt x***,*** opt y***);
               }
          }
  </code></pre>