jahlxx Posted August 10, 2016 Share Posted August 10, 2016 hi. how can I create a clone of a form in run time? I have a form and I need to have copies to be called feom other forms. thanks. Link to comment Share on other sites More sharing options...
Oliver Morsch Posted August 10, 2016 Share Posted August 10, 2016 When you create the form, choose "free form" (not "apllication form"). Then you can use: MyFormCopy := TMyForm.Create(uniApplication); MyFormCopy.Show; Link to comment Share on other sites More sharing options...
jahlxx Posted August 10, 2016 Author Share Posted August 10, 2016 the original form must be free form? Link to comment Share on other sites More sharing options...
Oliver Morsch Posted August 10, 2016 Share Posted August 10, 2016 It should be free form, because you should not use the function "MyForm" generated in application form. This function handles (creates and destroys automaticly) only one instance per session. Link to comment Share on other sites More sharing options...
jahlxx Posted August 18, 2016 Author Share Posted August 18, 2016 ok. I do: xxf: TUniForm; xxf:= Tffilter.Create(uniApplication); xxf.Show; this creates the clone ok. And in the form that creates the clone, I do; xxf.edit1.text := 'xxxxx'; this sentence, raises a compilation error; undeclared identifier edit1. any idea? thanks. Link to comment Share on other sites More sharing options...
Oliver Morsch Posted August 18, 2016 Share Posted August 18, 2016 xxf: TUniForm; ... xxf.edit1.text := 'xxxxx'; this sentence, raises a compilation error; undeclared identifier edit1. any idea? xxf is TUniForm and TUniForm has no edit1: (1) XXF: Tffilter; or (2) (xff as tffilter).edit1.text := 'xxxxx' Link to comment Share on other sites More sharing options...
mika Posted August 18, 2016 Share Posted August 18, 2016 xxf: TUniForm; should be xxf:Tffilter Link to comment Share on other sites More sharing options...
jahlxx Posted August 25, 2016 Author Share Posted August 25, 2016 Hi. xxf:Tffilter, raises a compilation error. Tffilter is not defined. Tha option that works for me is: xxf: TUniForm and (xff as tffilter).edit1.text := 'xxxxx' Thanks to all. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now