Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use existed Form as Tab in Delphi7

Tags:

delphi

pascal

My Delphi 7 application contains multiple forms I've already made. I would now like to make each individual form appear in a separate tab on a single container form. Because I'm new to Delphi, I don't know what approach to take, so what method(s) are available in Delphi for me to accomplish this?

Thanks you.

like image 243
user2047836 Avatar asked Feb 06 '13 17:02

user2047836


1 Answers

  1. Create a page control, TPageControl.
  2. Add 7 pages.
  3. Create your 7 forms.
  4. Add each form into its tabsheet.

The final step is as follows:

Form1.Parent := TabSheet1;
Form1.Align := alClient;
Form1.BorderStyle := bsNone;
Form1.ParentBackground := True;

Since you are doing this for 7 forms and 7 tabsheets, you'll want to do it in an array, and extract the code above into a method.

like image 124
David Heffernan Avatar answered Oct 18 '22 20:10

David Heffernan