Is this the best practice?
I cannot declare the windows in a module file because it will be accessible by other sessions (attached file).
If you meant another tab for “windows/pages”. Otherwise, objects in the same sessions are already available to all windows and pages. You can find then in Application.OpenForms and OpenPages.
You can always save a reference in Application.Session.
And there is the Application.FindComponent methods that can find any control in any window or page at any level in the session.
There are a few ways to do that. The way you have is fine. Application.Session is a dynamically allocated Key/Dictionary collection.
Another way is to add a public property to the the new window and assign a value to that when instantiating it in the first window. For example:
dim win2 as new Window2()
win2.SomePublicProperty = 5
It depends what you’re trying to do!
Please login first to submit.