|
发表于 2011-10-17 18:43:00
|
显示全部楼层
' Demonstrates SetData, ContainsData, and GetData
' using a custom format name and a business object.
Public ReadOnly Property TestCustomFormat() As Customer
Get
Clipboard.SetData("CustomerFormat", New Customer("Customer Name"))
If Clipboard.ContainsData("CustomerFormat") Then
Return CType(Clipboard.GetData("CustomerFormat"), Customer)
End If
Return Nothing
End Get
End Property
...
Public Class Customer
Private nameValue As String = String.Empty
Public Sub New(ByVal name As String)
nameValue = name
End Sub
Public Property Name() As String
Get
Return nameValue
End Get
Set(ByVal value As String)
nameValue = value
End Set
End Property
End Class
|
|