刚开始学点应用程序,希望得到大家的指点

解决方案 »

  1.   

    //窗体关闭
    private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
    {
             // Display a MsgBox asking the user to save changes or abort.
          if(MessageBox.Show("Do you want to save changes to your text?", "My Application",
             MessageBoxButtons.YesNo) ==  DialogResult.Yes)
          {
             // Cancel the Closing event from closing the form.
             e.Cancel = true;
             // Call method to save file...
          }
       
    }
      

  2.   

    如果你想关闭程序Process.GetCurrentProcess().Kill(); 
    就行了