Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing - i am getting better at this more help though
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Subclassing - i am getting better at this more help though
Divers
Thread ID:
00923810
Message ID:
00923810
Vues:
64
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?
Shawn Dorion
Geo Sektor Dot Com
Website: http://www.geosektor.com

Web Hosting Plans
Visit : http://WebHosting.Applications4u.com/
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform