[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

FORM on another FORM

Hi I want to reuse a form as a part of a mainform. Is it possible to use the form as a control. I've tried to set the property parent (parent was a panel) etc. But the form will still  be a standalone form.

0
Avataris
Asked:
Avataris
  • 2
1 Solution
 
Mohammed NasmanSoftware DeveloperCommented:
Hello
 
  you have to show the form first,

//==
  Form2.show;
  Form2.Parent := Panel1;

but if you have Delphi5, try to use the frames

0
 
Mohammed NasmanSoftware DeveloperCommented:
also may it's view, but not show within the panel, so adjust the top and left properties

procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2.show;
  Form2.Parent := Panel1;
  Form2.Left := 10; // or any position you would like
  Form2.Top := 10;
end;
0
 
dutiCommented:
Hi,

In Delphi 5, use the docking stuff.

Put a panel on the mainform.  When you want to reuse the form2, do following :

form2.ManualDock(formMain.panel1);
form2.Show;
// alClient = to fill the complete panel
form2.Align := alClient;
0
 
AvatarisAuthor Commented:
Thank you :)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now