Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating ActiveX Controls 1

Status
Not open for further replies.

jerstep

Technical User
Mar 22, 2002
18
0
0
AT
I am currently working on a system of displaying visually,the progress of various projects. I'm doing this by displaying a picture of a traffic light; the red light illuminated to show the project is behind schedule, amber to show the project is running according to plan and the green light to show the project is ahead of schedule.

I using 3 bitmaps for the traffic lights and just niserted them appropriately.

Would it be possible to create an ActiveX control for these lights, where a 'value' property would alter the colour of the traffic light ?

I've not created an ActiveX Control before so I've no idea if this is possible or not.

Does anyone have any ideas how I could go about this ?

Thanks.
J.
 
Its definitely possible; I'm just not sure it would be the best way to go. Will the interface be web-based or a Win32 app? Either way, simple programming techniques will allow for this same functionality without obfuscating the issue with an ActiveX control. ActiveX controls are ususally used when the same control needs to be available across multiple programs and/or needs to expose an object interface.

I'm assuming you will be pulling the status of the project from a database, textfile, MSProject, or setting it manually but I'm guessing that you will have a small set of web pages or a single Win32 app to display the bitmap(s). If you're using a web-based interface then a simple javascript with dhtml separated out as a .js file and pulled into the necessary pages would work fine. In a Win32 VB app you would simply have an image control on a form and a resource file with the three different versions of the signal. Use the LoadResPicture function to change out the image on the fly.
Code:
Set imgControl.Picture = LoadResPicture(Resource#, vbResBitmap)

Hope it helps but, if not, let me know,
Rob Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top