Hi,
I have two buttons (button1 and button2) in a form which does two different things.
button1 instantiates class A and does something and similarly button2 instantiates
class B and does something.
private void button1_Click(object sender, EventArgs e)
{
A a = new A();
a.DoSumthingWithA();
}
private void button2_Click(object sender, EventArgs e)
{
B b = new B();
b.DoSumthingWithB();
}
public class A
{
public void DoSumthingWithA()
{
// do something and
// fire a event to display a text in the form in a label all the subscribed clases should do this function.
}
}
public class B
{
public void DoSumthingWithB()
{
// do something and
// fire a event to display a text in the form in a label all the subscribed clases should do this function.
}
}
Now I want that whenevr anyone of the method gets execute an event should get triggered just to change the font of
a text in a label in the form.
now from where which class I should write the code to publish the event and where should I write the code to subscribe it.
I may have many more buttons in future which should also change the font.
Please help.
Regards,