ActiveX Control Tutorial - Part 5, Page 5
First off, I'd like to personally congratulate you on getting this far in the ActiveX control tutorial. It's been a tough course, but you're obviously a tougher cookie.
But where do you go from here? What should you do with this newfound talent?
Well, controls are a great way to encapsulate all your hard work and programming logic into a simple widget you can throw onto a form. Or an Excel spreadsheet. Or a Word document. Or whatever.
They allow you to take all the complicated stuff such as the code we wrote for the Super Cool Text Box control, the actual Text Box and so on and turn it into something simple, our end product.
Wondering where to go next? Here are a few control ideas I thought about whilst having a shower this morning:
- Improved Timer Control The current Timer that ships with Visual Basic fires off, at the very least, once every 65535 milliseconds (just over a minute). Sometimes I want a timer to fire every ten minutes or so and end up writing code to increment a timer counter, fire off, reset the counter and start again from the beginning. It gets very sticky though all this work could be encapsulated into a control.
- Date Picker Control - You could take Microsoft's existing Date Picker control and add your own unique properties. For instance, IsWeekend (Boolean), FirstDayOfMonth (Date) and LastDayOfMonth (Date). If you wanted to be really groovy, I'm sure an IsPublicHoliday (Boolean) would also be greatly appreciated!
- Marquee Control How about creating a control that scrolls text along a Text Box or Label? I guess you'd use the Timer control to activate the movement, and change the Interval depending on how fast you wanted the text to move.
- Do That API Thang As the VB-World.net API section (www.vb-world.net/api/) shows, you can do a lot of groovy stuff with API calls. For instance, you could spice up the Text Box control by adding new features (http://www.vb-world.net/controls/textboxex/). Or include new properties in the Tree View control, such as 'BackgroundColour' currently only changeable via API calls.
... and the list goes on!
So go ahead and let us know how you progress! Feel free to post your achievements right here on our bulletin board.
If you're interested in what other programmers are getting up to, you might want to check out:
- Progress Control See how the guys at VBWeb created a progress control that throws Microsoft's Progress Bar right out the window.
- Chart Control Learn how our very own Sam Huggil decided the Microsoft Chart control was too big to distribute with his applications so created his own version! (I'd also like to mention that Sam has a couple of neat ActiveX control tutorials here.
- Hyperlink Control - Once again, the chaps behind VBWeb dress to impress with this groovy Hyperlink control. (More controls from VBWeb here).
- Visual Dice Control Check out how VBExplorer knocked up a visual die for potential use in games.
Check these out, look at the source code, learn how they work. That's the best way to continue exploring ActiveX controls.
You may also want to check out the VB-World.net Component Source store, which lists dozens of commercial third-party controls.