Hello
My origional goal was to override the X button, so instead of closing it would minimize to the task bar. I reached my goal by using the following code:
Now the only way the program could be closed was by pressing the 'Close' menu item.
This just opens a new issue: I CAN'T SHUT DOWN MY COMPUTER!!!. While the program is running (on a windows XP machine) the machine wouldn't shut down. It would be much appriciated if someone could tell me another way to override the X button or just some other way to solve my problem
My origional goal was to override the X button, so instead of closing it would minimize to the task bar. I reached my goal by using the following code:
Code:
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
this.Hide();
e.Cancel = true;
}
Now the only way the program could be closed was by pressing the 'Close' menu item.
Code:
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
Application.Exit();
}
This just opens a new issue: I CAN'T SHUT DOWN MY COMPUTER!!!. While the program is running (on a windows XP machine) the machine wouldn't shut down. It would be much appriciated if someone could tell me another way to override the X button or just some other way to solve my problem