Event handling an array of controls



I have a number of LinkLabel controls on a form, and I want to write a
single handler for all of them, where the handler will determine which
LinkLabel has been clicked, and action can then be taken using a Select Case
structure. I am aware that an event handler can handle multiple events, but
rather than having:

Handles LinkLabel1.LinkClicked, LinkLabel2.LinkClicked,
LinkLabel3.LinkClicked ...

I would like to use an array:

Handles myArrayOfLinkLabels.LinkClicked

This method would allow one to add additional controls and have then handled
without modifying the handler each time. I am certain that in my distant
past I have come across this (before .NET, I think).

Can anyone advise how to achieve what I have described above, or maybe
provide a relevant link?

Thanks in advance,
IMB


.



Relevant Pages

  • Re: javascript custom object event handling and this
    ... > The method you are using to assign the event handler actually ... The value of instance's - HandleKeyDown - is a reference to a function ... to call an object instance method without ...
    (microsoft.public.scripting.jscript)
  • Re: javascript custom object event handling and this
    ... > The method you are using to assign the event handler actually ... The value of instance's - HandleKeyDown - is a reference to a function ... to call an object instance method without ...
    (microsoft.public.scripting.jscript)
  • Re: list of raised events
    ... > Hi Tim, ... > datagrid 's sortcommand handler statically or dynamically at runtime? ... > event handler will be lost when the page is posted back. ... I think Kevin's suggestion that check the form fields ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to pass more than two parameters in the event handler
    ... That information is passed into the event handler ... curveArray data without passing parameters in. ... private void plotCurves(ZedGraphControl zgc, int[,] curveArray) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Tcl bug?
    ... being substituted in the context of TraceOP. ... You don't show the event handler code, so one can't say how you get from ... when registering the handler, and keep a hash table of tkwin pointers back to the Lisp instance. ... specifying neither returns nothing but does not return an error. ...
    (comp.lang.tcl)