Hi all.. Good Day.
i have problem with form inheritance... i have 2 form in my application. Second form inherited from First form. i placed 1 button in first form...
I wand to write some code that should work while i'm click second form.... second form button that inherited from first form....
in second form wer i can write my code... ??
thanks....
Loading

Kirtan PatelPosted Jul 31, 2009, 2:51 PM
public virtual void button1_Click(Object Sender, EventArgs e)
{
MessageBox.Show("Called Function of Form1");
}
//In form 2 Override that method to implement new functionality to button like below
public override void button1_Click(object Sender, EventArgs e)
{
MessageBox.Show("This Is From Form2");
}
now when you click button from Form1 It Will Execute the Form1's Click Event and When you Click it From Form 2 it will Execute Overridden Method
Happy Coding :)
Shouketh EKPosted Aug 3, 2009, 1:42 AM
good day.
thank you for u'r help. this is very usefull for me. And i solved this problem trough event.