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.
jvierra
Posts: 14155
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: PowerShell form message displays twice on exit

Post by jvierra » Thu Feb 06, 2020 10:15 am

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 1 time

Post Reply