directxBOB
asked on
C# Virtual Close
I am getting:
"Use the new keyword if hiding was intended"
While it's only a warning I would like to eliminate it as I know it's something simple I am not doing.
My code is:
"Use the new keyword if hiding was intended"
While it's only a warning I would like to eliminate it as I know it's something simple I am not doing.
My code is:
private void menuItem1_Click(object sender, EventArgs e)
{
this.Close();
}
public virtual void Close()
{
string str2 = @"Are you sure you wish to quit? Any changes you have made will be lost.";
string caption2 = "Confirm Addon Exit";
DialogResult dResult;
dResult = MessageBox.Show(str2, caption2, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
if (dResult == DialogResult.Yes)
{
base.Close();
}
}
ASKER
Yeah I was thinking that but I get:
Error 3 'Form1.Close()': cannot override inherited member 'System.Windows.Forms.Form .Close()' because it is not marked virtual, abstract, or override
Error 3 'Form1.Close()': cannot override inherited member 'System.Windows.Forms.Form
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Regards,
Bruce
Open in new window