Variables

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

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.

 

 

  • You must to post comments
0
0

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

  • You must to post comments
0
0

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 ?

 

 

 

 

  • You must to post comments
0
0

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

  • You must to post comments
Showing 3 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json