Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Raising events.

0 views
Skip to first unread message

Gawelek

unread,
Jan 1, 2003, 7:10:59 PM1/1/03
to
How can I raise an event from one control, and send it to the another
control ?

For example , I have two buttons A i B. When A will be clicked, B should
receive Click event.
Something like this - ...Send(A(sender), B(receiver), Click(event),
Arg(arguments))

Gawel

Joe Mayo

unread,
Jan 1, 2003, 8:36:17 PM1/1/03
to
I believe you could create a new class B derived from Button, give it a
constructor that will take a reference to A, create a callback, and have B
register for the click event of A.

Joe

--
Joe Mayo, Author - C# Unleashed
http://www.amazon.com/exec/obidos/ASIN/067232122X/cstati
Free C# Tutorial @ C# Station
http://www.csharp-station.com


"Gawelek" <gaw...@NOSPAMEKpoczta.gazeta.pl> wrote in message
news:av002q$bh8$1...@news.tpi.pl...

Greg Low

unread,
Jan 2, 2003, 2:51:02 AM1/2/03
to
In that case, are you really wanting to send an "event". Couldn't you just
call the event procedure for button B in the event handler for button A?

HTH

Greg Low
Brisbane, Oztralia

"Gawelek" <gaw...@NOSPAMEKpoczta.gazeta.pl> wrote in message
news:av002q$bh8$1...@news.tpi.pl...

Gawelek

unread,
Jan 2, 2003, 8:05:21 AM1/2/03
to

> In that case, are you really wanting to send an "event". Couldn't you just
> call the event procedure for button B in the event handler for button A?

Yes, that's right. I use such a construction, but I am wondering if it is
possible to do it differnetly.

Gawel


Uzi

unread,
Jan 2, 2003, 10:21:01 AM1/2/03
to
because events are muticast delegates, you can add to event A (click) a
calling to event B.
Just Add the event handler of button b to the click event of button A using
the A.click += eventhandler(b.click event)

"Gawelek" <gaw...@NOSPAMEKpoczta.gazeta.pl> wrote in message

news:av1des$d22$1...@news.tpi.pl...

Gawelek

unread,
Jan 2, 2003, 10:51:03 AM1/2/03
to
> because events are muticast delegates, you can add to event A (click) a
> calling to event B.
> Just Add the event handler of button b to the click event of button A
using
> the A.click += eventhandler(b.click event)

It will be great solution, if I needed both of thet at the same time.
But I need sequential execution :
private void start_Click(object sender, System.EventArgs e) - it is for A

{

Computations.......

Raise_Click_Event_For_B

}

Gawel


0 new messages