elGringo Posted October 19, 2016 Posted October 19, 2016 For the moment I can understand that difference in calling them To call Application form we should use SomeApplicationForm.Show(); To call FreeForm we should use ... var SomeFreeForm:TSomeFreeForm; begin SomeFreeForm:=TSomeFreeForm.Create(UniApplication); SomeFreeForm.Show(); ... // SomeFreeForm.Free; // << somewhere in the code So - what else different beetwen them? Is ApplicationForm is more modern - with automatical memory management on it? What approach is more reliable from your experience? Quote
elGringo Posted October 20, 2016 Author Posted October 20, 2016 Theme up - nobody knows? Just wanted best practice - or noone knows? Quote
Oliver Morsch Posted October 20, 2016 Posted October 20, 2016 Application form is the easy one. Create and Free works automaticly, just call the name. Free form is more flexible. You can decide when create and free is called and you can have more than one form instance per session. Quote
elGringo Posted October 20, 2016 Author Posted October 20, 2016 Oliver, thank you ! So you use mostly Application form? Quote
Oliver Morsch Posted October 21, 2016 Posted October 21, 2016 Mostly I work with dynamicly created frames on tabsheets. Quote
jahlxx Posted October 24, 2016 Posted October 24, 2016 hi oliver. can you upload a sample? I am trying to do the same. thanks. Quote
Oliver Morsch Posted October 25, 2016 Posted October 25, 2016 hi oliver. can you upload a sample? I am trying to do the same. thanks. procedure TfrmMain.OpenFrame(Sender: TObject); var ts: TUniTabSheet; fra: TUniFrame; begin ts := TUniTabSheet.Create(self); ts.Caption := (Sender as TUniMenuItem).Caption; ts.PageControl := PageCtrl; // PageCtrl.TabIndex := -1; // Workaround / Issue #1025 / Nicht mehr notwendig ?! PageCtrl.ActivePage := ts; fra := TFrameClass((Sender as TUniMenuItem).Tag).Create(self); // type TFrameClass = class of TUniFrame; ts.Tag := Integer(fra); // call "TComponent(PageCtrl.ActivePage.Tag).Free;" when close TabSheet (ActivePage) later fra.Name := fra.Name + IntToStr(Integer(fra)); // to open a frame more than once fra.Align := alClient; fra.Parent := ts; end; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.