Fábio Matte Posted February 20, 2018 Share Posted February 20, 2018 Good afternoon. I have a situation. When declaring form1 within form2 in uses and then referencing an Edit or other component, the system instead of picking up information, it opens form1 instead of just picking up information from the field. Example: 1. Form1 is already open and inside it has a Button that calls form2; 2. Inside form2 I need to load form1 Edits information, so I do so: Edit2.text: = Form1.Edit1.text; And instead of loading the data from Edit1, it opens a new instance of Form1. In pure Delphi this works normally, but with Unigui, it opens a new instance. Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted February 20, 2018 Share Posted February 20, 2018 Hello Fabio, IMHO (in my humble opinion), Best practice : Never use circular reference as VCL. Use instead a Common UniDataModule where you can declare all common variables (section property) : 1. Prepare your common variable : TMyCommonDataModule=Class Private fmyText:string; Public Property myText:string read fmyText write fmyText; end; 2. Send from your Form1 your Text : MyCommonDataModule.MyText:=Form1.uniEdit1.Text; 3. In Form2, Retreive your Text: Form2.uniEdit1.Text:=MyCommonDataModule.MyText; With this technic all will be secure : you guarantee that variables are only for your unique session (one instance). _____________ Good to read : http://www.unigui.com/doc/online_help/application-forms.htm Best regards. Quote Link to comment Share on other sites More sharing options...
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.