读书人

VB.net转C#有关问题

发布时间: 2012-04-24 14:15:38 作者: rapoo

VB.net转C#问题
Public Property MyItem(ByVal Index As Integer) As Object
Get
Return DisplayRow.Cells(Index).Value
End Get
Set(ByVal value As Object)
DisplayRow.Cells(Index).Value = value
End Set
End Property

请问各位,上面的代码用C#如何实现啊?

[解决办法]

C# code
public object this[int Index]{    get { return DisplayRow.Cells[Index].Value; }    set { DisplayRow.Cells[Index].Value = value; }}
[解决办法]
C# 单纯的get set
楼上的正解

读书人网 >C#

热点推荐