The issue has nothing to do with PSS. It is a PowerShell specification.
The thing that fools most is that forms events are really functions. We assign a script block to the event handler which is cast to a "delegate" which is like a function. It has a scope local to the script block. All variables created or changed in a form event are not visible outside of the event. All controls are visible and can be changed from an event. This is what a "delegate" is used for in a form.
Forms are not like PS1 scripts because they use events and can queue events.
Referencing Variables across the events
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.