• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 577
  • Last Modified:

How to convert inherited control into DLL in c# csharp .net

I have several inherited controls (text boxes, combo boxes) which I can drag from the tool box and drop on the form.

But I would like to make them into DLL's, so that I can use them in various future projects? How do I do that?

Thanks!
0
yaronusa
Asked:
yaronusa
  • 3
  • 2
3 Solutions
 
Anurag ThakurCommented:
create a class library project and add all the controls to it
then add the reference to the project in which you want to use the controls
if you want to add the controls to the tool box then select add remove and select the assembly and add to the toolbox and then you can drag and drop the controls to the user interface as other windows controls
0
 
yaronusaAuthor Commented:
So I started a class library project, and added all the files to it, but I am having a problem with the following using statement on all the inherited controls:

using System.Windows.Forms;

Windows is underlined, and cannot be found, even with the intellisense.

Am I on the right track?

What will the reference to this class library project be? The namespace of my class library is CustomTextBoxes and the project name is TextBoxes.

Thank for your help I really appreciate it.
0
 
Anurag ThakurCommented:
System.Windows.Forms (in System.Windows.Forms.dll)
0
 
yaronusaAuthor Commented:
Alright...
 
 I added the reference System.Windows.Forms to the TextBoxes project and the Windows is no longer underlined.
 To compile the Class Library project, I created an executable project.
 
 Then I created a new Windows Application called TestDriveTextBoxes project, and I added a reference to the TextBoxes.dll that was generated. But none of my inherited controls have shown in the toolbox anywhere.
 
 So I went back to the TestDriveTextBoxes project and in the toolbox, under the category 'TextBoxes Components' it says "There are no usable controls in this group. Drag an item onto this text to add it to the toolbox." So I try to do that, but it can't go on there.

Do you know why the inherited controls are not showing?
0
 
yaronusaAuthor Commented:
OK, it was a simple mistake: the access modifier to my class was not public; an inherited control that is put into a class library project for the purpose of being referenced by other projects needs its inherited classes that represent controls be publicly accessible.

Thank you for helping me find the solution; couldn't do it without you.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now