First subscribe to the Form's Closing event. After that in the event handler you can cancel the close:
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
}
But this code alone will prevent you from ever closing the application! In order to provide a way of closing the form, you can use a flag to determine whether or not the closing event should be cancelled.
I hope this helps. :)