我正在将 VB.NET 代码翻译成 C#.. 有一个问题:
我有一个获取Control
对象的方法,我需要向它发送不同的控件
private void ApplyToAllPictureBoxes(ref Control oControl, ViewMode Mode)
{
// ...
}
ApplyToAllPictureBoxes(ref Panel1, Mode);
ApplyToAllPictureBoxes(ref myFlowLayoutPanel, Mode);
但它抛出
“最好的重载方法匹配有一些无效的参数”
这是 VB.NET 代码:
Private Sub ApplyToAllPictureBoxes(ByRef oControl As Control, ByVal Mode As ViewMode)
' ... '
End Sub
ApplyToAllPictureBoxes(myFlowLayoutPanel, Mode)
ApplyToAllPictureBoxes(Panel1, Mode)
我怎样才能做到这一点?