$Mainform.Close() did not execute immediately

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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.
This topic is 1 year and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
owinsloe
Posts: 161
Last visit: Tue Mar 26, 2024 8:14 pm
Been upvoted: 1 time

$Mainform.Close() did not execute immediately

Post by owinsloe »

Product: PowerShell Studio 2022 (64 Bit)
Build: v5.8.206
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.19044.0

Within my OnLoadFormEvent for my mainform I performed a test-path for a file and if not present threw a popup (Show-popup) and followed this by $Mainform.close().

I expected this to terminate the UI immediately but, it continued, evident by another progress form being displayed and then after progress form close, it terminated.

The behaviour was corrected by adding a 'return' following the $mainform.close()

NOTE: This was done via the PSS Editor, not from a packaged EXE
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: $Mainform.Close() did not execute immediately

Post by brittneyr »

[Topic moved to PowerShell GUIs forum by moderator]
Brittney
SAPIEN Technologies, Inc.
User avatar
owinsloe
Posts: 161
Last visit: Tue Mar 26, 2024 8:14 pm
Been upvoted: 1 time

Re: $Mainform.Close() did not execute immediately

Post by owinsloe »

Interesting, after I posted this issue I noticed there was a new v5.8.207 build, so installed it.

Guess what?

Problem fixed!

Lightening fast resolution :D

Cheers
This topic is 1 year and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked