title: How to avoid issues when embedding a TForm in another TForm?
body: <p>I often embed a <code>TForm</code> descendant into another <code>TForm</code> descendant like this:</p>
  
  <pre><code>var
    Form1: TForm1;
    Form2: TForm2;
  begin
    Form2.Parent      := Form1;
    Form2.BorderStyle := bsNone;
    Form2.Align       := alClient;
    Form2.Show;
  end;
  </code></pre>
  
  <p>Usually this works just fine, but sometimes the controls in Form2 are not aligned properly. Is there a general workaround for this sort of problem?</p>
  
  <p>Does anybody know what is causing this "misalignment"?</p>
  
  <p>I know that I could use <code>TFrame</code> for this kind of job, but I have a lot of library code that I would have to rewrite and I do not see any reason why the <code>TForm</code> in <code>TForm</code> approach should not work?</p>
  
  <p><strong>Edit:</strong> I have identified the component <code>TcxListView</code> as the culprit here, I have submitted a bug report to the component vendor (DevExpress):</p>
  
  <p><a href="http://www.devexpress.com/issue=B194161" rel="nofollow">http://www.devexpress.com/issue=B194161</a></p>
  
  <p><strong>Edit 2:</strong> The developers at DevExpress have analyzed the problem and said that it is actually a defect in the <code>TGridPanel</code> component by Embarcadero:</p>
  
  <p><a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=90324" rel="nofollow">http://qc.embarcadero.com/wc/qcmain.aspx?d=90324</a></p>