Force the non-closing of the form after command

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.
Post Reply
User avatar
adminmicro
Posts: 13
Joined: Thu Oct 03, 2013 11:51 am

Force the non-closing of the form after command

Post by adminmicro »

Hello,

I use a module PowerShell SolarWinds in a form.
If I use a command from the SolarWinds module, my form closes :-(

Is it possible to force the non-closing of the form ?

Thanks
Best regards

Product, version and build: Studio 5.8.183
Operating system : Windows 10 Build (Version 2004)
PowerShell version(s) : 5.1.19041.610

User avatar
brittneyr
Site Admin
Posts: 695
Joined: Thu Jun 01, 2017 7:20 am
Answers: 10
Been upvoted: 8 times

Re: Force the non-closing of the form after command

Post by brittneyr »

[Topic moved by moderator to PowerShell GUIs forum]

You should try to figure out what is causing your form to close rather than preventing the form from closing. I recommend putting a try/catch around the command and debugging to see why the command is causing an error.
Brittney Ryn
SAPIEN Technologies, Inc.

User avatar
adminmicro
Posts: 13
Joined: Thu Oct 03, 2013 11:51 am

Re: Force the non-closing of the form after command

Post by adminmicro »

I deleted the associated button and do a recreate with copy/paste code, and it works...

Post Reply