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.
adminmicro
Posts: 13
Last visit: Fri Feb 26, 2021 12:15 am
Post
by adminmicro » Fri Feb 19, 2021 5:37 am
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
brittneyr
Site Admin
Posts: 699
Last visit: Fri Mar 05, 2021 1:53 pm
Answers: 10
Been upvoted: 9 times
Post
by brittneyr » Fri Feb 19, 2021 7:24 am
[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.
adminmicro
Posts: 13
Last visit: Fri Feb 26, 2021 12:15 am
Post
by adminmicro » Fri Feb 19, 2021 8:45 am
I deleted the associated button and do a recreate with copy/paste code, and it works...