3 Replies - 1056 Views - Last Post: 03 November 2009 - 05:33 AM Rate Topic: -----

#1 n0c0d3   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 48
  • Joined: 21-December 08

How to make a class permanently available to every (new) project?

Posted 01 November 2009 - 07:56 AM

With some help I've created a class that adds a TextBox with some custom properties to the toolbox. But it's only available when the project I created it in is opened itself. I'd like to have available it in the toolbox at all times.
I've tried to create a "class library" and put the code inside, created a "CustomClasses" namespace, changed the root namespace in the project-properties, but nothing seems to work. I'm using VB express btw.
Any suggestions?

Thanks,
Bart

This post has been edited by n0c0d3: 01 November 2009 - 07:59 AM


Is This A Good Question/Topic? 0
  • +

Replies To: How to make a class permanently available to every (new) project?

#2 Asscotte   User is offline

  • D.I.C Addict
  • member icon

Reputation: 35
  • View blog
  • Posts: 610
  • Joined: 08-February 09

Re: How to make a class permanently available to every (new) project?

Posted 01 November 2009 - 05:08 PM

You could manually add it each time or you could create a wizard or template to start from
Was This Post Helpful? 0
  • +
  • -

#3 motcom   User is offline

  • D.I.C Lover
  • member icon

Reputation: 293
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: How to make a class permanently available to every (new) project?

Posted 03 November 2009 - 01:15 AM

Hi,

The default way to do it is make a class library, compile it, and when you make a new project, add a reference to the compiled DLL.

Maybe there is a setting in the ide where you can automatically add a reference to that DLL....
Was This Post Helpful? 0
  • +
  • -

#4 n0c0d3   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 48
  • Joined: 21-December 08

Re: How to make a class permanently available to every (new) project?

Posted 03 November 2009 - 05:33 AM

View Postmotcom, on 3 Nov, 2009 - 08:15 AM, said:

Hi,

The default way to do it is make a class library, compile it, and when you make a new project, add a reference to the compiled DLL.

Maybe there is a setting in the ide where you can automatically add a reference to that DLL....


I always want it "my' way, but then without the "my namespace" ;)
I compiled a "conversion" class as well to try how the namespaces work, even though it isn't finished yet.
Creating different libraries with the same name didn't work out as I hoped. Only one of them ends up in the all components listing of the object browser, still they did both end up in the Custom Component Set, but then they were below each other, both with the name "CustomClasses", which was not really convenient imho.

Now I created different class libraries with the names like "FormsAndControls" and "Conversions". These do both end up in the All Components listing of the OB after adding them to the custom component set, just not in the same parent namespace, that's something I'll have to learn to live with ;), but in the Custom component set they're well recognizable.
I don't think I have to add references when I use them. At least the custom textbox works as I expect it to without reference. Adding it to the toolbox and the custom component set seems to be enough as I've been able to find out so far.

Thanks,
Bart
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1