Windows Form as Control in DLL
-
I'm not sure whether this can be achieved, but here goes. I have created a new color dialog for a simple html editor. I would like to packeage the form into a dll, so that when added to a project, the dialog appears in the toolbox. I am using C# express 2005. I can achieve this when creating a normal control but I am stumped when it comes to having a form in the dll instead. If anyone has any ideas as to how to achieve this, or even a small demo, I would be truly grateful.
-
I'm not sure whether this can be achieved, but here goes. I have created a new color dialog for a simple html editor. I would like to packeage the form into a dll, so that when added to a project, the dialog appears in the toolbox. I am using C# express 2005. I can achieve this when creating a normal control but I am stumped when it comes to having a form in the dll instead. If anyone has any ideas as to how to achieve this, or even a small demo, I would be truly grateful.
This is actually done quite frequently. It wouldn't be a Control in the DLL, but rather a Windows Form in the DLL, which you can initialize and invoke just like you would with any other form outside of the DLL.
Pete Soheil DigiOz Multimedia http://www.digioz.com
-
This is actually done quite frequently. It wouldn't be a Control in the DLL, but rather a Windows Form in the DLL, which you can initialize and invoke just like you would with any other form outside of the DLL.
Pete Soheil DigiOz Multimedia http://www.digioz.com
Hi, Yes I can do this. What I want to achieve, is see the form like the current colordialog in the toolbox to the side of the design window.
-
Hi, Yes I can do this. What I want to achieve, is see the form like the current colordialog in the toolbox to the side of the design window.
Mike Kitchen wrote:
Hi, Yes I can do this. What I want to achieve, is see the form like the current colordialog in the toolbox to the side of the design window.
In design view, just right-click on the Toolbar, choose "Add/Remove Items" and select your custom library that contains your control. You can only do this for custom controls though, not for actual forms.
Pete Soheil DigiOz Multimedia http://www.digioz.com
-
Hi, Yes I can do this. What I want to achieve, is see the form like the current colordialog in the toolbox to the side of the design window.
Mike Kitchen wrote:
like the current colordialog in the toolbox to the side of the design window.
Then you need two things. You need the custom control with a designer implementation so it can be in the toolbox and dropped on a form by a developer. The interface (API) you create for the control supplies the mechanism that is used at runtime to launch the Windows Form that is also in the assembly (or in another assembly I suppose).
-
Mike Kitchen wrote:
like the current colordialog in the toolbox to the side of the design window.
Then you need two things. You need the custom control with a designer implementation so it can be in the toolbox and dropped on a form by a developer. The interface (API) you create for the control supplies the mechanism that is used at runtime to launch the Windows Form that is also in the assembly (or in another assembly I suppose).
OK. I am being a bit slow with this. So could you point me in the right direction to achieve this please. If I get it sorted I will post the dialog as an article.
-
OK. I am being a bit slow with this. So could you point me in the right direction to achieve this please. If I get it sorted I will post the dialog as an article.
I doubt you will find an example of doing exactly what you intend. You need to piece the inforamtion together. I suggest you first learn how to create a custom control. That's pretty simple but then you need to learn about implementing the Visual Studio designer support. From there you should be able to see how your non windowed control is used by a developer to implement the showing of the form that is in the assembly. My original post contains the key words you would use in google to start researching, something like: MSDN Windows Forms custom control designer
-
I doubt you will find an example of doing exactly what you intend. You need to piece the inforamtion together. I suggest you first learn how to create a custom control. That's pretty simple but then you need to learn about implementing the Visual Studio designer support. From there you should be able to see how your non windowed control is used by a developer to implement the showing of the form that is in the assembly. My original post contains the key words you would use in google to start researching, something like: MSDN Windows Forms custom control designer
Hi Yep, started doing a few google searches and I have come up with a few links, so hopefully I am on my way with it now. Thanks for the help, and if I get it sorted I will post the control as an article.