Value
返回异步读取的结果,类型为Variant。只读。
语法:object.Value
- object
- 必需 求值为AsyncProperty对象的对象表达式。
Value仅在AsyncReadComplete事件中有意义——在进度通知期间读取尚未完成。Value的具体子类型由AsyncType决定:
vbAsyncTypePicture—— stdole.IPictureDisp,可赋给Picture属性。vbAsyncTypeFile—— String,保存包含下载数据的临时文件路径。vbAsyncTypeByteArray—— Byte数组(Byte()),保存原始字节。
示例
此示例在完成事件中读取Value并将结果赋给控件的Picture属性。
vb
Private Sub UserControl_AsyncReadComplete(AsyncProp As AsyncProperty)
If AsyncProp.PropertyName = "Picture" Then
Set UserControl.Picture = AsyncProp.Value ' Value是IPictureDisp
End If
End Sub另见
- AsyncType 属性
- PropertyName 属性
- Target 属性