Click here to Skip to main content
15,917,473 members
Home / Discussions / C#
   

C#

 
QuestionHow can i hadle Windows Taskbar events Pin
sherwani20-Mar-06 20:23
sherwani20-Mar-06 20:23 
AnswerRe: How can i hadle Windows Taskbar events Pin
Shaun Harrington11-Oct-06 4:00
Shaun Harrington11-Oct-06 4:00 
QuestionWord Under Mouse Pointer Pin
qumer10120-Mar-06 20:08
qumer10120-Mar-06 20:08 
AnswerRe: Word Under Mouse Pointer Pin

MmM.net</

21-Mar-06 22:40

MmM.net</

21-Mar-06 22:40 
QuestionRe: Word Under Mouse Pointer Pin
qumer10122-Mar-06 2:46
qumer10122-Mar-06 2:46 
QuestionFinding if given point lies inside the polygon Pin
sulakshana_b1120-Mar-06 19:48
sulakshana_b1120-Mar-06 19:48 
AnswerRe: Finding if given point lies inside the polygon Pin
AB777120-Mar-06 21:33
AB777120-Mar-06 21:33 
GeneralRe: Finding if given point lies inside the polygon Pin
sulakshana_b1120-Mar-06 21:45
sulakshana_b1120-Mar-06 21:45 
GeneralRe: Finding if given point lies inside the polygon Pin
AB777121-Mar-06 0:00
AB777121-Mar-06 0:00 
AnswerRe: Finding if given point lies inside the polygon Pin
Guffa21-Mar-06 0:49
Guffa21-Mar-06 0:49 
QuestionMethod versioning Pin
Jeevan Jyoti20-Mar-06 19:08
Jeevan Jyoti20-Mar-06 19:08 
AnswerRe: Method versioning Pin
Ahmad Mahmoud [candseeme]20-Mar-06 19:32
Ahmad Mahmoud [candseeme]20-Mar-06 19:32 
GeneralRe: Method versioning Pin
Jeevan Jyoti20-Mar-06 19:49
Jeevan Jyoti20-Mar-06 19:49 
AnswerRe: Method versioning Pin
Bob Stanneveld20-Mar-06 21:24
Bob Stanneveld20-Mar-06 21:24 
Hello,

Consider the following code example:
// Some class that you can use
public class Foo
{
    public virtual string DoFoo() { return "Foo.DoFoo"; }
    public virtual string DoBar() { return "Foo.DoBar"; }
}
 
public class DerivedFromFoo
{
    public override string DoFoo() { return "DerivedFromFoo.DoFoo"; }
    public new      string DoBar() { return "DerivedFromFoo.DoBar"; } 
}
 
public class Main
{
    public static void Main(string[] args)
    {
        DerivedFromFoo derivedFromFoo = new DerivedFromFoo();
        Console.WriteLine(derivedFromFoo.DoFoo());
        Console.WriteLine(derivedFromFoo.DoBar());
 
        Foo foo = (Foo)derivedFromFoo;
        Console.WriteLine(foo.DoFoo());
        Console.WriteLine(foo.DoBar());
        
        Console.ReadLine();
    }
}

When you run the above code, you'll see the following output:
DerivedFromFoo.DoFoo
DerivedFromFoo.DoBar
DerivedFromFoo.DoFoo
Foo.DoBar


You see that you hide the base class DoBar with a new function. Typecasting the derived class to the base class calls the original function. When you use override, you replace the implementation of the base class with a completely new one.

Hope this helps. Big Grin | :-D


Behind every great black man...
            ... is the police. - Conspiracy brother


Blog[^]
QuestionBasic Question about threading Pin
kpkr20-Mar-06 15:53
kpkr20-Mar-06 15:53 
AnswerRe: Basic Question about threading Pin
Vikram A Punathambekar20-Mar-06 16:42
Vikram A Punathambekar20-Mar-06 16:42 
AnswerRe: Basic Question about threading Pin
AB777120-Mar-06 17:58
AB777120-Mar-06 17:58 
GeneralRe: Basic Question about threading Pin
CWIZO20-Mar-06 19:38
CWIZO20-Mar-06 19:38 
QuestionCellphone software Pin
ab2moro20-Mar-06 15:21
ab2moro20-Mar-06 15:21 
AnswerRe: Cellphone software Pin
mcljava21-Mar-06 4:55
mcljava21-Mar-06 4:55 
QuestionC# Plugin for Internet Explorer? Pin
sim*20-Mar-06 14:21
sim*20-Mar-06 14:21 
AnswerRe: C# Plugin for Internet Explorer? Pin
K.sundar20-Mar-06 17:21
K.sundar20-Mar-06 17:21 
QuestionGetting the command line as a whole Pin
Brett Slaski20-Mar-06 12:57
Brett Slaski20-Mar-06 12:57 
AnswerRe: Getting the command line as a whole Pin
George L. Jackson20-Mar-06 15:17
George L. Jackson20-Mar-06 15:17 
GeneralRe: Getting the command line as a whole Pin
Brett Slaski21-Mar-06 1:43
Brett Slaski21-Mar-06 1:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.