Public Property [Name]() As Integer
Get
Return ds_DriverList.Tables("ds").Rows(ListViewDriver.SelectedItems.Item(0).Index)("DriverName")
End Get
Set(ByVal Value As Integer)
End Set
End Property
Public Property [ID]() As Integer
Get
Return ds_DriverList.Tables("ds").Rows(ListViewDriver.SelectedItems.Item(0).Index)("DriverID")
End Get
Set(ByVal Value As Integer)
End Set
End Property
我想同时从窗口窗体中返回名称和 ID。怎么做?
p/s:如果只返回 ID,那是有效的,但我想返回多值
更新
Public Structure NameID
Public Name As String
Public ID As Integer
End Structure
Public Property ID() As NameID
Get
Return New NameID With {.Name = ds_DriverList.Tables("ds").Rows(ListViewDriver.SelectedItems.Item(0).Index)("DriverName"), .ID = ds_DriverList.Tables("ds").Rows(ListViewDriver.SelectedItems.Item(0).Index)("DriverID")}
End Get
Set(ByVal Value As NameID)
End Set
End Property
这是返回值。错误的...
MsgBox(f.ID.ToString())
这就是我获得返回值的方式