Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Error management in an event handler in a powershell form

$
0
0

Hi guys

I wrote a powershell form using event handler. It ask for a name and a IP adress and other things

In the event handler,

- if the user leave the name blank, I open a message box saying it should not be empty

- if the user enter a wrong ip adress, I open a message box saying it should be like x.x.x.x

If both occurs, it displays 2 message box.

But I would like to display only the first message box of the first error and then exit the handler, to avoid displaying many messages.

How to exit from a handler  and stay in the form  (not like the cancel button handler which close the form with a form.close() statement)

I tried break statement or exit without success

thanks

ML






Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>