# How to disable close button?

**URL:** https://tech-community.robotics.abb.com/t/how-to-disable-close-button/3466
**Category:** Developer Tools
**Created:** [March 25, 2010, 11:15am UTC](https://tech-community.robotics.abb.com/t/how-to-disable-close-button/3466 "2010-03-25T11:15:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![wolfino](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/wolfino/32/3246_2.png) [@wolfino](https://tech-community.robotics.abb.com/u/wolfino)
#### Post date: [March 25, 2010, 11:15am UTC](https://tech-community.robotics.abb.com/t/how-to-disable-close-button/3466/1 "2010-03-25T11:15:44Z")

</div>

Hello,  
Does anyone know whether it is possible to temporally disable the colose button (in the upper right corner) of my app window as it is in Back up window while backing up?

---

<div class="post-metadata">

### Author: ![newform](https://avatars.discourse-cdn.com/v4/letter/n/67e7ee/32.png) [@newform](https://tech-community.robotics.abb.com/u/newform)
#### Post date: [March 26, 2010, 5:25pm UTC](https://tech-community.robotics.abb.com/t/how-to-disable-close-button/3466/2 "2010-03-26T17:25:45Z")

</div>

## you can try another option: whenever a user click “close” button, check if you are backuping or doing other jobs using FormClosing event. The following is an example posted on the web for your reference. It is written in C#

private void Form1\_Closing(object sender, System.ComponentModel.CancelEventArgs e)  
{  
// check if you are backing up something  
if(MessageBox.Show(“Are you sure you want to exit?”, “Confirm exit”, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)  
{// ignore close behave  
e.Cancel = true;  
}  
}
