If I find something odd like this I go back to first principles and make a blank test project with just the code in I want to test. This is put on the Window1 of a new project.
Sub Action() Handles Action
Self.Close
End Sub
This performs as expected on Windows so its probably your app logic doing something odd, or it would be something wrong with the version of Xojo you’re using (if its alpha/beta etc).
Did you open the window in some special/different way?
Does the CANCELCLOSE or CLOSE event refer to ANY attribute of the window (property, control, etc)?
If so, and IMPLICIT INSTANCE is check (which by default it is), then the Window does in fact close, but immediately REOPENS because you made a direct or indirect reference to it again.
I believe the problem is that it was supposed to return a value and there was no return statement in the close method. The problem went away and I think that’s what did it.