I prefer to just disable the X using the VI Properties... less code on diagram to have to worry about. And the user doesn't have a useless [X] button to keep clicking on that doesn't do anything. Unless, of course, you're going to actually add code so that the [X] button causes Exit.
There is also the option in VI Properties->Window Appearance to disable "Allow use to close window". My personal preference is to use the Panel Close? event as asbo has already mentioned.