DarkRoomW.frmMain.clearToolStripMenuItem_Click C# (CSharp) Method

clearToolStripMenuItem_Click() private method

private clearToolStripMenuItem_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void clearToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult UserResponse = new DialogResult();
            if (txtPage.Modified)
            {
                UserResponse = MessageBox.Show("Would you like to clear the contents of your documents? This action cannot be undone.", "Warning", MessageBoxButtons.YesNoCancel);
            }
            if (txtPage.Modified & UserResponse == DialogResult.Cancel)
            {
                return;
            }
            else if (txtPage.Modified & UserResponse == DialogResult.Yes)
            {
                txtPage.Clear();
            }
        }