public void ConfirmQuit()
    {
        var dialogResult = MessageBox.Show("really want exit game ?", "system message", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

        if (dialogResult == DialogResult.OK)
        {
            Application.CancelQuit();
            //TODO write you logic method

            Application.Quit();
        }
    }