Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to override a click method in a button on a form?
Message
De
17/06/2004 21:44:11
 
 
À
14/06/2004 23:19:56
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00913730
Message ID:
00914889
Vues:
19
Hi Kevin, I definitely have that book and read it and did the exercises (great book). I also was aware of how to override methods in C#. Please take a peek at my reply to Bonnie in this thread. I explained my question a little better hopefully there. Thanks for your help!

>Mark,
>
>I'm not completely sure this will help or cover your situation, but let me throw out some general stuff, and if it doesn't answer your question, maybe someone else can jump in.
>
>Let's say you have a function in a base class, one that you may wish to 'override' when you subclass it. We'll call it 'myfunction'.
>
>You need to declare it with the virtual keyword, and then when you subclass it, you use the 'override' method. For instance..
>
>-base class
>public virtual string MyFunction()
>{
> return "base";
>}
>
>-subclass (which inherits from your base class)
>public override string MyFunction()
>{
> return "override";
>}
>
>Now, that is a complete override. There are times in the subclassed instance where you may want to run the 'base' behavior (sort of like a DODEFAULT() in VFP). In that instance, you can use the 'base' keyword to call the base method (e.g. base.MyFunction()
>
>At the risk of advertising, there's an excellent book ".NET for VFP Developers" that has a good section on Object Oriented development in VB and C#. It's available on Amazon and www.hentzenwerke.com, and it worth the price ten-fold.
>
>Hope this helps,
>Kevin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform