Hi!
Is this the best practice?
I cannot declare the windows in a module file because it will be accessible by other sessions (attached file).
Thanks,
Ulisses.
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.
https://wisej.com/docs/2.0/html/M_Wisej_Web_Application_FindComponent.htm
Hi Ulisses,
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
win2.ShowDialog()
It depends what you’re trying to do!
Best regards,
Levie
Another tab is another session. You can share statics across sessions but you need to handle the thread synchronization like in any multi threading system.
Please login first to submit.