title: How i can to make a procedure for create a form?
body: <p>I have this procedure :</p>
  
  <pre><code>procedure TForm1.Button1Click(Sender: TObject);
  var
     a:TForm2;
  begin
      a := TForm2.Create(Self);
      a.Parent := ScrollBox1;
      a.Align := alClient;
      a.Show;
      a.SetFocus;
  end;
  </code></pre>
  
  <p>And i change that above code to this, but i receive a error, Why?
  I must change this code to?</p>
  
  <pre><code>procedure TForm1.MakeAform(aForm:Tform;Cmp:TComponent;Parent1:TWinControl;Align1:TAlign);
  var
     a:aForm; // Error Here
  begin
      a := aForm.Create(Cmp);
      a.Parent := Parent1;
      a.Align := Align1;
      a.Show;
      a.SetFocus;
  end;
  
  procedure TForm1.Button2Click(Sender: TObject);
  begin
       MakeAform(Tform2,Self,Panel1,alClient);
  end;
  </code></pre>