Is it possible to create a class with a component built in?

ProgMan

Well-known member
Joined
Nov 25, 2006
Messages
55
Location
UK
Programming Experience
3-5
Hi everybody :)

I was wondering if there was a way to create a class with vb components built in.

For example, I like to use the timer component in my applications (which displays a real time clock). But everytime dragging the component in my forms and using the same code in the Timer1_Tick() function is kinda boring !!

So, I was thinking if it is possible to create a class (or something similar) containing this timer component so that I can just import the file in my applications whenever I want to display a clock.

Thank you.
 
Yes.

You could actually create this as a User Control, and have it compile to a dll.

then all you need to do is reference the dll and add the control into any form you want!
 
Thank you very much jwh for your reply :)

Glad to hear that it can be done.

Could you please tell me (or post any links) how I can achieve this ? :eek:

Edit : ok..I've done a quick google search and it seems there are a number of articles on how to create custom controls...so I'm gonna look at those now. Thanks again :)
 
Last edited:
Back
Top