iLogic to know if global Form (UserForm) is open

iLogic to know if global Form (UserForm) is open

engilic
Advocate Advocate
770 Views
2 Replies
Message 1 of 3

iLogic to know if global Form (UserForm) is open

engilic
Advocate
Advocate

Hi,

 

Is it possible to get information on whether a global Form (UserForm in VBA Editor) is open or not in iLogic code, its probably eassy in VBA but do not know how to do it in iLogic?

 

Thank you.

 

Have a lovely day.

0 Likes
Accepted solutions (1)
771 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Hi @engilic 

If were talking about a VBA UserForm here, it has a 'hidden' property called Visible that returns a Boolean.  Checking its value will likely only work if your form was shown as non-modal (so that it can be open in the background while allowing you to interact with other things).  To check it, just use a simple If...Then statement, and after If put the name of the Form (without quote marks), as if it were an object variable, then a dot (.), then Visible, then your Then.  So if your UserForm is named MyForm, the line would look something like this:

If MyForm.Visible Then
Call MsgBox("The form is open", , "")
Else
Call MsgBox("The form is closed.", , "")
End If

As for a regular iLogic Form (local or Global), I don't think I've ever seen any kind of built-in property or method for checking if it is open.  One trick I've seen others use is something like a SharedVariable with a Boolean value, and when they launch the form, create the variable and give it a value of True, and when they close the form, either just change the variables value to False, or delete the variable.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3

engilic
Advocate
Advocate

Thank you @WCrihfield ,

 

This is awesome.

0 Likes