A Real-Time VB6 ActiveX News Control
- Introduction
- Creating the ActiveX control
- Obtaining our news with XMLHTTP
- Displaying the link
- Compiling and using our new ActiveX control
- Conclusion
Creating the ActiveX control
We will use the five most recent items in the returned XML file and create a hyperlink to each one in a new browser window. The hyperlink will feature a proper hand icon, and while the XML is being retrieved in the background, a progress bar will display the status of the retrieval.
Start by firing up Microsoft Visual Basic 6. Choose the ActiveX Control option and click on the OK button, as shown below:
Name your project "prjXMLNews" and your control "ctrlNews". Set its background colour to white. Resize the control so that it's about 2500 twips wide by 5400 tips in length. When the XML document is being retrieved from the MoreOver.com server, our control will display a progress bar telling the user what is going on. We need to use the Project -> Components menu option to add the "Microsoft Windows Common Controls 6.0" library to our project. This will allow us to drop a progress bar onto our control. We also need a reference to the "Microsoft XML, v4.0" library.
Also, as mentioned above, our control will display the five most recent XML items retrieved from the MoreOver.com new feed. Each one will be displayed as a label control, which will have hyperlink to the actual URL of the news story.
There are a number of ways that we can retrieve the icon for the hyperlink (you know, the "hand" icon). Because we are creating an ActiveX control, I have chosen to add a picture box, with its Picture property set to the actual image of the hand cursor. The location for this cursor varies from machine to machine, so I have already included it as part of the control.
So far, our ActiveX control looks like this:
Now that I've described how the control will operate, and what it will look like, let's talk about using the XMLHTTP library to retrieve our XML news from MoreOver.com.
You might also like...
About the author
Mitchell Harper
Visit http://www.devarticles.com for more articles and free programming eBooks, or visit Socket6.com for your dose o...
Interested in writing for us? Find out more.
XML books
-
Programming with Microsoft Visual Basic 2008
Programming with Microsoft Visual Basic 2008, Fourth Edition by the best-selling author, Diane Zak, is designed for a first course in programming. Using the most recent version of the software, Visual Basic 2008, this book teaches individuals how to ...
XML forum discussion
-
CorelDRAW VBA: cdrTraceLineDrawing FAILS, producing single linear path instead of Centerline trace?
by dancemanj (0 replies)
-
client/server application using activex
by beautifulheart (0 replies)
-
System Error &H8007007E. The specifed module could not be found.
by swiftsafe (5 replies)
-
Invitation to take part in an academic research study
by researchlab (0 replies)
-
Send SMS with SMPP
by mmahmoud (0 replies)
XML podcasts
-
Stack Overflow Podcast: Podcast #45 – Keeping it Sharp
Published 7 years ago, running time 0h54m
Our guest this week is Eric Lippert – language architect extraordinaire and famous for all his work at Microsoft in developing their languages Eric joined Microsoft right out of college and was originally working on VB It’s time for everyone’s favorite game: Name the Worst Feature of that Microso.
Comments