Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to override a click method in a button on a form?
Message
From
14/06/2004 23:19:56
 
 
To
14/06/2004 22:35:33
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00913730
Message ID:
00913747
Views:
21
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform