I have a button that has a click event that calls a method called AuthenticateUser()
private void btnOK_Click(object sender, System.EventArgs e)
{
this.AuthenticateUser();
}
I subclassed this button.
On my button in the click event I put this code.
public void btnOK_Click(object sender, System.EventArgs e)
{
bool lResult = this.Login_Click();
if (!lResult)
this.txtCompanyID.Focus();
}
when I run the form it runs the authenticateUserCode and then it runs my code.
the only way to stop this was to add the following code
protected override void AuthenticateUser()
{
}
Now it appears to only run my code.
The question i have is why is it running that code in the first place i put code on my button, this code should override the base class code shouldn't it.
I tried adding override to the button but i get and error.
Considering the button is declared as private, then it should only run my code right?