how to enable/disable control on different form
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
how to enable/disable control on different form
I have a project i'm working on in Powershell Studio 2012. I have two forms. I have a control on the main form that by default is disabled. The second form is a preference list. What i'm trying to do is if I change one of the selections on the preference form have the control on the main form be enabled. I can't seem to figure out how I can reference that control to enable it before I close out the second form.
Re: how to enable/disable control on different form
In PowerShell there is no interform communication. You can only display and work with one form at a time. You can pass arguments to a new form for it to use when it is displayed but once the new form is displayed the calling script cannot execute until the that form is closed.
Re: how to enable/disable control on different form
Thats what it was afraid of, I found documentation on how to do it from C#.
Is there some type of event I can leverage when I return to the first form so I can check for these setting changes I make. I'm writing these prefences to the registry so they are persistant.
Is there some type of event I can leverage when I return to the first form so I can check for these setting changes I make. I'm writing these prefences to the registry so they are persistant.
Re: how to enable/disable control on different form
PowerShell and Forms are not capable of creating classic programs because they do not support more than one thread. Many of the things you will need to do for a classic Forms based program cannot be done with PowerShell.
PowerShell is fro scripting. It is not a way for a non-programmer to build programs.
You can build simple utilities with PowerShell and do some very nice things but the learning curve is steep for non-programmers.
With PowerShell we can build large projects with multiple forms very easily however some things still cannot be done. All forms in PowerShell Studio are 'Modal'. That means that once a form is displayed all script execution that started the form will be blocked until the form is closed. One form can call another and pass variables but that script will be blocked until the called form is closed.
The form object can be queried after it is closed. It contains all changes and selections.
Please read the blog posts on how to use controls with PowerShell Studio as most if not all of these questions will be answered.
PowerShell is fro scripting. It is not a way for a non-programmer to build programs.
You can build simple utilities with PowerShell and do some very nice things but the learning curve is steep for non-programmers.
With PowerShell we can build large projects with multiple forms very easily however some things still cannot be done. All forms in PowerShell Studio are 'Modal'. That means that once a form is displayed all script execution that started the form will be blocked until the form is closed. One form can call another and pass variables but that script will be blocked until the called form is closed.
The form object can be queried after it is closed. It contains all changes and selections.
Please read the blog posts on how to use controls with PowerShell Studio as most if not all of these questions will be answered.