Closing Child Form exits the application and no exception information

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 5 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
User avatar
TheVito
Posts: 12
Last visit: Fri Nov 25, 2022 7:59 am

Closing Child Form exits the application and no exception information

Post by TheVito »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: 5.6.157
32 or 64 bit version of product: 64
Operating system:Windows 10
32 or 64 bit OS: 64

*** Please add details and screenshots as needed below. ***

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

I have a main form which is a tabcontrol form, I created a child form that is shown on start up of the main, the show is in the load function for the main form, the child pops up just fine, i am able to gather the information i need and it gets passed back to the main form properly when I click the OK button to close the child form. So far so good.

I added a button to my main tab control form to show the child form again to change my selections, it pops up fine, but when I click the OK button it returns back to the main function where I called the show of the child form the entire application closes down with no errors. I tried stepping into and it just closes everything no errors, i deployed the script to a file and ran inside powershell command window and no exceptions, i checked the windows application event logs hoping i would see some error but nothing.

What further information can i provide?

thanks
User avatar
Alexander Riedel
Posts: 8489
Last visit: Thu Apr 18, 2024 1:15 pm
Answers: 20
Been upvoted: 37 times

Re: Closing Child Form exits the application and no exception information

Post by Alexander Riedel »

[Moved to correct forum by moderator]
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8489
Last visit: Thu Apr 18, 2024 1:15 pm
Answers: 20
Been upvoted: 37 times

Re: Closing Child Form exits the application and no exception information

Post by Alexander Riedel »

Probably best if you could posts a trimmed down version of your application. Just the bits in question.
Alexander Riedel
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Closing Child Form exits the application and no exception information

Post by jvierra »

First don't launch a form from the load event. Use the "Shown" event instead. The load even needs to complete before the main form is fully initialized. If this doesn't help then follow Alexanders suggestion and post a minimal example.

If this happens in a PS1 file then the issue is likely something in your code and not with PowerShell Studio or in how Forms work.
This topic is 5 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