From Xojo Documentation
Supported PlatformsProject Types: Desktop Platforms: macOS, Windows, Linux
Used to determine if the user has pressed Escape (on Windows or Linux) or Command-period (on macOS) or to cancel the execution of code.
result = UserCancelled
|result||Boolean||Result is True if the user has pressed Escape (on Windows or Linux) or Command-period (on macOS) or and False if the user did not cancel.|
The UserCancelled function will continue to return True until the event handler that was executing when the user pressed Escape or Command-period is finished.
This example uses the UserCancelled function to exit a For loop if the user presses Command-period/Escape.
For i As Integer = 0 To kMax
ProgressBar1.Value = (i / kMax) * ProgressBar1.Maximum
If UserCancelled Then