form create

im making a form at run time but when i create form i cant access form1 anymore the focus shifts to new form and i have to close form1 in order to be able to access anything on form1.

How can i have 2 forms which allow for one to be inactive with focus while i'm using the other form?

my code

procedure TForm1.Button1Click(Sender: TObject);
nForm: TForm;
lstbx: TListBox;
begin
  nForm := TForm.Create(Application);
  lstbx := TListBox.Create(nForm);
  with nForm do
  try
  Parent := Form1;
  Height := 150;
  Width := 350;
  caption := 'Test';
  horzscrollbar.Visible := false;
  vertscrollbar.Visible := false;
  snapbuffer := 20;
  screensnap := true;
  with lstbx do
  begin
  Parent := nForm;
  Width := 350;
  Height := 150;
  end;
  ShowModal();
  finally
  nForm.Release();
end;
end;
Thor371Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BlackTigerXCommented:
just don't call ShowModal

call Show instead

nForm.Show();

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Thor371Author Commented:
ty tiger
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.