Yeah, that's right - I've been using 2005 beta for a while and am already
used to that!
OK, basically, you just need to make a class library, or anything that
compiles to a DLL. But you can also create a new project file and create a
"Windows Control Library", all that does is make the project type a dll and
auto-adds a starter "User Control".
If you're familiar with old-school stuff, with ActiveX controls - you needed
to compile an OCX that would have your controls within it. In the new world,
you can put controls in ANY dll. So that means you could have a support dll
that has some business logic like say MyCompanySupport.dll - you could also
put windows controls in that dll. you don't need to have a seperate file for
that.
To work backwards, when you right-click and choose "Add/Remove components",
and when you browse for a your DLL, when you click OK - it scans that dll
you chose and sees if there are any windows controls it can load from it.
So how do "make" a windows control? Well you can either extend an existing
control by inheriting from it. Try that by creating a new class (just an
empty, regular class - normally called "Class1"). Then change:
public class Class1
to be
public class Class1 : System.Windows.Forms.ComboBox
Now, you will have an addable component called "Class1" that will look/act
just like a combo box.
To make your own control (again, the same concept as an old-school ActiveX
control) - right-click on your project and add a new class, but choose "User
Control". Draw whatever you need to on that, and again - once compiled, that
will show up as an icon in the toolbox.
Hope that helps..
"Keith Smith" <ke*********@verizon.net> wrote in message
news:pNyNd.7665$uc.1081@trnddc04...
If you right-click inside the Toolbox (where the textbox, combobox, etc
are) - there is a menu item "Choose items..." - choose that, and find the
DLL that has your controls - that will load it into the "Toolbox"..
Oh, I think I see. Mine is actually a little different than you are
describing. Mine has "Add/Remove Components"...but either way it does let
me browse for a DLL file.
So, then in order to use the code I have pasted I would need to put the
code in a DLL? Could you take me through those steps? Unless it is to
time-consuming to type here then maybe you could point me to a good link?