herculanojs Posted October 13, 2016 Posted October 13, 2016 Was there any possibility or way to change the parent of a form created dynamically? form := TUniFormClass(FindClass('TUniForm1')).Create(UniApplication); form.Parent := UniTabSheet1; form.Align := alClient; Quote
jahlxx Posted October 21, 2016 Posted October 21, 2016 Hi. I have a similar problem. did you solved it? Quote
herculanojs Posted October 21, 2016 Author Posted October 21, 2016 I still can not resolve this issue. For now using frame Quote
Administrators Farshad Mohajeri Posted October 21, 2016 Administrators Posted October 21, 2016 Was there any possibility or way to change the parent of a form created dynamically? form := TUniFormClass(FindClass('TUniForm1')).Create(UniApplication); form.Parent := UniTabSheet1; form.Align := alClient; This should already work. Quote
jahlxx Posted October 22, 2016 Posted October 22, 2016 and if the form is already created? how to set the parent in that case? Quote
Administrators Farshad Mohajeri Posted October 22, 2016 Administrators Posted October 22, 2016 Parent of an already created form can not be changed. Quote
jahlxx Posted October 24, 2016 Posted October 24, 2016 something like this? this is in other topic: http://forums.unigui.com/index.php?/topic/7329-create-uniform-in-runtime-set-parent-help/ form := TUniFormClass(FindClass('TUniForm1')).Create(UniApplication);form.Parent := UniTabSheet1;form.Align := alClient; This could be a good solution, but: I have tested, but the app, shows form and form1. Is because if form1 code are sentences that references form1, like; with form1 do begin ..... end; I don't know how to solve this. cout use the same name, but this raises a compilation error: form1 := TUniFormClass(FindClass('TUniForm1')).Create(UniApplication); Other problem is references to form1, from other forms. Any idea? Quote
Administrators Farshad Mohajeri Posted October 24, 2016 Administrators Posted October 24, 2016 If you create form dynamically you should no longer use Form1 in your code. Use your created instance instead. Quote
jahlxx Posted October 24, 2016 Posted October 24, 2016 ok. there is something I don't understand. If I do in that way, and I changr the references to form insted of form1, the compiler raises errors. form1 not identified. ??? Quote
jahlxx Posted October 24, 2016 Posted October 24, 2016 I'm trying to simulate the mainform in the all features demos, but without having a frame for every form. Create the frame in run time and assignn a form to that frame, but I can't find the way to do this. 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.