1
我問這個問題以前在vb.net每個控件數組,但我想這樣做在C#..事件在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
如何將其轉換爲C#?要添加