I'm running a VI with a while loop in it but when I want to close the VI using the "x" button (the top right window button) the VI closes but the loops keeps on running as well. There is got to be something about this but I can't find anything.
What version of LabVIEW and OS are you using? If it's at least LV 5.1 and 32 bit Windows, you could use a vi called "Monitor for close.vi" to certainly monitor when your front panel is closed and wire a FALSE to your while loop. You can find "Monitor for close.vi" in the Developer Zone
You have to include include the Front Panel Window Open property in the while loop condition. When this property gets to be false the loop must stop. Use Application control menu Property Node in LV 6i or 5.x