>Hi. i am coming from vfp backgroup and new in .net. i am trying to subclass a simplebutton or textbox control of .net framework and make my own class. i want to put then my own textbox /button on the form. i was able to create subclass but cant figure out few other things. lets say i have a custom method on my texbox class to activate popup dialog box if certain key is pressed. in my base textbox class, I have a code in textbox's keypress event to call this custom method.
>
>now after adding mytextbox class to my windows form, i want to be able to change something in that custom method. i.e. call base class's method first and then add few lines of my code. how can i do that?
>
>
>thanks for help in advance
Like this ?
public class One
{
public void Something()
{
Console.WriteLine("one");
}
}
public class Two : One
{
public new void Something()
{
base.Something(); // call base class' method
Console.WriteLine("two"); // do something else
}
}
Gregory