我想将下面的 VB.net 代码写入 C#。C# 中最好的等效代码是什么:
Private Sub AllControlDesign2(ByRef TB As Control)
If TB.GetType Is GetType(StatusStrip) Then
CType(TB, TextBox).ReadOnly = True
TB.BackColor = stFromBackColour
TB.ForeColor = Color.Gray
End If
End Sub