- Creating Visual Basic Components for the Web
- Making a Web-Aware ActiveX Custom Control
- Understanding Custom Controls and Asynchronous Transfer
- Working with UserControl.AsyncRead
- Downloading a Graphic
- Understanding Properties in Terms of AsyncRead
- Working with the FileSystemObject
- Compiling the Custom Control
- Packing the Custom Control
- Deploying the Custom Control with a Sample Page
- Updating the Custom Control
- Conclusion
Understanding Custom Controls and Asynchronous Transfer
Visual Basic 6 allows you to read data from an Internet server asynchronously. In other words, you can create custom controls that can make one or many different calls back to an Internet server for data and have the data returned in a common data stream. As that data returns, a notification mechanism in the control handles the data processing. Intelligence that is built into the Visual Basic UserControl object can sort out the return from the data stream and assign the right data to the right data call. This means that you can integrate data on the Internet into the operation of your custom controls.
Let's put this concept to work. We'll make a custom control that downloads a poem from my Web site when you click on a CommandButton and also displays the poem in a TextBox control. Also, when the CommandButton is clicked, a graphic of the company logo is downloaded and displayed in the PictureBox control. (See Figure 1.)
Figure 1: The custom control consists of PictureBox, TextBox, and CommandButton