- 积分
- 4340
- 明经币
- 个
- 注册时间
- 2010-10-23
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2011-10-17 18:43:55
|
显示全部楼层
' 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
...
<Serializable()> 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
|
|