OnProgress Event  
 

The OnProgress event is generated as the data stream is being read or written.

Syntax

Sub object_OnProgress ( [Index As Integer], ByVal BytesTotal As Variant, ByVal BytesCopied As Variant, ByVal Percent As Variant )

Remarks

The OnProgress event is generated as the control reads the data stream from the remote host or writes a data stream to the remote host. If the data stream contains large amounts of data, this event can be used to update a progress bar or other user-interface control to provide the user with some visual feedback. The arguments to this event are:

BytesTotal
The total amount of data being read or written in bytes. This value will be the same as the maximum size of the data stream specified by the caller. If the size was unknown or unspecified at the time, then this value will always be the same as the BytesCopied value.
BytesCopied
The number of bytes that have been read or written.
Percent
The percentage of data that's been read or written, expressed as an integer value between 0 and 100, inclusive. If the maximum size of the data stream was not specified by the caller, this value will always be 100.

Note that this event is only generated by the ReadStream, StoreStream and WriteStream methods. If the control is reading or writing data using the Read or Write methods the application is responsible for calculating the completion percentage and updating any user interface controls.

See Also

Read Method, ReadStream Method, StoreStream Method, Write Method, WriteStream Method