Forum Discussion

tsmith92765's avatar
tsmith92765
Copper Contributor
Jan 18, 2023
Solved

MessageBox not able to click "X" on the msgbox and cancel the script from continuing.

Hello PS Community!  I have a message box that works perfectly fine, but I want to adjust my code to be able to cancel the script upon clicking the big red "X" on the message box that pops up.   I ...
  • Vinod_5's avatar
    Jan 21, 2023
    Hi tsmith92765,
    Good day!
    It is not possible to rename fields supported by MessageBoxButton. It has fields OK, OKCancel, YesNo, YesNoCancel. You can make use of OKCancel. Although you can create your requirement easily with new form.
    Please refer fields section of the url article below.
    https://learn.microsoft.com/en-us/dotnet/api/system.windows.messageboxbutton?view=netframework-4.8
    Thank you.

Resources