PowerShell form message displays twice on exit

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 4 years and 2 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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: PowerShell form message displays twice on exit

Post by jvierra »

YOU are still a mile away from understanding how to use forms. The closing event just does what you want. There is no need to keep calling a close function. Just let the form close the way it is designed to be closed and use the even to decide if you really want to close the form./

See the following which does exactly what you want. It is how forms work. You are trying to think that you have to write code that is already built into the form.

I Here is the documentation that describes what WinForms are and how they are designed to work.

https://docs.microsoft.com/en-us/dotnet ... /winforms/
Attachments
Track.psf
(29.12 KiB) Downloaded 75 times
This topic is 4 years and 2 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