arilotta Posted January 15, 2018 Share Posted January 15, 2018 Hi all, I'm having some troubles setting object references between different forms at design time; reference is not kept when forms are closed and reopened. For example, setting the TDataSource property for a TUniDbGrid when the two objects belong to different forms (TUniForm descendents). However, if I place the TDataSource on the UniMainModule, it works. Is anyone else experiencing the same problems ? Thanks Andrea Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted January 15, 2018 Administrators Share Posted January 15, 2018 Hi, It is a general Delphi behavior. Links are gone when Form is closed. It is always good to avoid linking objects across forms. Quote Link to comment Share on other sites More sharing options...
arilotta Posted January 15, 2018 Author Share Posted January 15, 2018 Sorry to say, but it is not happening with usual VCL TForms. Just create a simple project with 2 forms, place a tdatasource in Form1, place a dbgrid in form2, add Form1 in the uses of Form2, set the DBGrid's datasource property to the datasource in form1. The close Form2, or close the project, and reopen it: the link is manteined. This does not happens between TUniForms, only between TUniMainModule and TUniForms... 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.