In VWG I was able to add the following code to the main form.
Public Shared ReadOnly Property MainForm() As Myapp
Get
Return CType(VWGContext.Current.MainForm, Myapp)
End Get
End Property
I was then able to access any variable, methods, functions on the main form from any other form using
Myapp.myvariable
Might be obvious but is there anyway of doing this in Wisej.
Hi Dave,
maybe I just did not fully understand your needs. Here are various approaches that you can use
to access variables in other windows:
((MyMainForm)Application.MainPage).MyVar
or
Public Shared ReadOnly Property MainForm() As Myapp Get Return CType(Application.MainPage, Myapp) End Get End Property
or
CType(Application.OpenForms(“Window1”),Window1).MyVar
Please note that OpenForms and OpenPages are collections and MainPage can be used as a reference to the main page
if your app created one.
I hope this clarifies it a bit. If it does not, please send a small test app and what you are trying to achieve to
me at frankATiceteagroup.com
Thanks !
Best regards
Frank
Sorry, I’m probably being stupid. None of those options expose the variables that are set on the startup form. (I cant find them anyway !)
How would you access a variable on the startup form from another form ?
Hi Dave,
with Wisej it should be a lot easier to achieve what you are trying to do here.
Methods that can help you are e.g. Application.OpenForms, Application.OpenPages,
Application.FindComponent, Application.MainPage, Application.Desktop etc.
Hope that helps.
Best regards
Frank
Please login first to submit.