form in the tab lazarus / 10-Designer ---------------------------------------------------------------------- deepblue · 2009-11-02 04:32 Hi All, I have some form and i want to place the forms in the tab. Is it possible? How to do it? Share please Thanks ---------------------------------------------------------------------- Leledumbo · 2009-11-02 06:49 Via docking, I think it's possible. The form can be created at runtime and docked to a TPageControl or similar controls. ---------------------------------------------------------------------- LazaruX · 2009-11-02 09:54 If you mean MDI, that is not possible ---------------------------------------------------------------------- cdbc · 2009-11-02 15:46 Hi Deepblue. I don't know if it's something like this you're after.... Code: [Select]procedure TfrmMain.TabControl1Change(Sender: TObject); begin   case TabControl1.TabIndex of     0: begin          if assigned(fDiaryForm) then begin            fDiaryForm.Close;            FreeAndNil(fDiaryForm);          end;        end;     1: begin          fDiaryForm:= dfmDiary.TfrmDiary.Create(TabControl1);          fDiaryForm.Parent:= TabControl1;          fDiaryForm.Align:= alClient;          fDiaryForm.Show;        end;     2: begin //         Panel1.Visible:= false;          if assigned(fDiaryForm) then begin            fDiaryForm.Close;            FreeAndNil(fDiaryForm);          end;        end;     3: begin //         Panel1.Visible:= false;          if assigned(fDiaryForm) then begin            fDiaryForm.Close;            FreeAndNil(fDiaryForm);          end;        end;   end; end; HTH Regards Benny ---------------------------------------------------------------------- deepblue · 2009-11-02 15:58 @leledumbo I have tried, but how to destroy the form when i want close in the tabs? @BPSoftware Yes.. But My question is i want to place form in the tabs. @Benny i think that at the code, the controls in form doesn't be in the tab.. @all is there other technique to handle the forms to become user friendly for user? thanks all ---------------------------------------------------------------------- cdbc · 2009-11-02 17:55 Hi again... I use code like this, every now and then, it works fine, tried to upload screenshot, but forum says it's full??? To create the form: Code: [Select]fDiaryForm:= dfmDiary.TfrmDiary.Create(TabControl1); { tab is owner }          fDiaryForm.Parent:= TabControl1; { important, form will be drawn as component on tab }          fDiaryForm.Align:= alClient; { fit to tab clientarea }          fDiaryForm.Show; { do NOT use showmodal } To destroy the form: Code: [Select]if assigned(fDiaryForm) then begin   fDiaryForm.Close;   FreeAndNil(fDiaryForm); end; Just to clarify. Regards Benny