private void simpleButton1_Click(object sender, EventArgs e) { if (loading) cancelLoad = true; else this.Close(); }