Read about delegates. C# doesn't have function pointers. Delegates supply
more or less the same functionality, but in a cleaner way.
Pete
"Ronnie Smith" <(E-Mail Removed)> wrote in message
news:18621DCE-A0D9-4D69-9A4A-(E-Mail Removed)...
>I am trying to pass a function (method) address to a user control to
> associate with an event.
>
> The small user control which sends events is contained in a larger user
> control group which is in turn contained in the main application. I need
> the
> event handler to exist at this top level in the application, and so I'm
> trying to somehow let the small control (two layers down) know the
> address
> of this handler, so that the function is called.
>
> I thought I could have the main application pass the address of the top
> level event handler to the user control group, which could then pass it on
> to
> the small controls. However when I try to pass the function name as a
> parameter from the top level the compiler is asking for parenthesis -
> which
> obviously won't do what I want.
>
> Perhaps I am going about all this the wrong way anyway.
>
> Any ideas?
|