Closing the Child form Closes the Parent form also

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 3 years and 11 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
VenkatSGS
Posts: 4
Last visit: Mon Sep 06, 2021 4:27 am

Closing the Child form Closes the Parent form also

Post by VenkatSGS »

I have a multi-form project created in Powershell Studio. It contains atleast 20forms.
The Main form acts as a login window and the next form contains 5 buttons to open different forms. One button opens a child form and when I close it it closes the parent form also. However the other 4 buttons does not display this behaviour. I have done some basic de-bug however I could not find or fix why it is closing the parent form. Requesting your Help.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Closing the Child form Closes the Parent form also

Post by jvierra »

There is no way we can guess at what is causing this. It is clearly a coding or design issue. Without you code there is no way to guess at the cause.
VenkatSGS
Posts: 4
Last visit: Mon Sep 06, 2021 4:27 am

Re: Closing the Child form Closes the Parent form also

Post by VenkatSGS »

with the help of your other post I found the solution.

The DialogResult of that button was set to Cancel. I changed it to none and it seems working.
This topic is 3 years and 11 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