i asked this question previously in vb.net but i want to do it in c#..
Private Sub cbtns_ClickButtonArea(ByVal Sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles cbtn_a.ClickButtonArea, cbtn_b.ClickButtonArea, cbtn_c.ClickButtonArea, cbtn_d.ClickButtonArea
Dim cbtn As CButtonLib.CButton() = {cbtn_a, cbtn_b, cbtn_c, cbtn_d}
Dim clickedBtn As CButtonLib.CButton = DirectCast(sender, CButtonLib.CButton)
For Each cb As CButtonLib.CButton In cbtn
If cb Is clickedBtn Then
cb.Enabled = False
Else
cb.Enabled = True
End If
Next
End Sub
how to convert this to c#?
Something like this
and
Since c# does not have and equivalent to
Handles, the event handlers have to be added like it’s shown above.