In VB.net, I handle many button clicks in one method. Then I use a select case to figure out what to do with the request, see below:
Private Sub picT1_Click(sender As Object, e As EventArgs) Handles picT2.Click, picT3.Click, picT4.Click,
Select Case sender.name
Case "picT2"
If PLC.T2Shutter = BitOff Then do something...
Case "picT3"
If PLC.T3Shutter = BitOff Then do something...
Case "picT4"
If PLC.T4Shutter = BitOff Then do something...
End Select
End Sub
Since I am going to manipulate a variable with similar indexing (PLC.T2Shutter from picT2.Click event), how can I address the right variable by somehow using the received "2" in the name of the sender?