tags:

views:

44

answers:

2

I created a TextBoxControl which is inherited from Infragistics.Win.UltraWinEditors.UltraTextEditor, an Infragistics control. As showed below.

public class TextBoxControl : Infragistics.Win.UltraWinEditors.UltraTextEditor
{
  //My Stuff
}

At some level Infragistics.Win.UltraWinEditors.UltraTextEditor class also inherited from WinForm's "Control" class. My problem is, this control is not appearing in the ToolBox. I done two steps 1. Choose from browse option and select the dll where the class present 2. Drag and drop the dll directly to the ToolBox

In-fact both are same, TextBoxControl control is not appearing in the ToolBox, what i missing here.

Edit : TextBoxControl class have empty constructor, nothing special in this class.

+1  A: 

That should work:

  1. Right click on any ToolBox item (eg. Pointer)
  2. Select Choose items
  3. Click on Browse and select the .dll
  4. It will automatically select all controls imported from that .dll
  5. Just drag & drop the control your TextBoxControl to your form.

Important: Those controls will be added to the specified tab under ToolBox. Eg:

If you are under Containers, then those controls will be added to that Tab.

You could create a new tab to store those controls (if you have more than one or two), or just add it to Common Controls.

If you drag & drop a control to your form, you will see that the dll is referenced in your project.

tsocks
Don't know what you mean with "I drag and dropped the dll to the ToolBox". That's not what I said. Did you follow the above steps?
tsocks
@tsocks : The five steps you given can be achieved by easily. Select the desired dll, Drag and Drop the MyControl.dll into toolbox itself, the controls present in the MyControl.dll will appear on the ToolBox. I did both the ways. The only difference between this two methods is, while choosing by browse and select, we can select appropriate controls, in Drag and Drop all the controls present in the .dll will be added to the ToolBox.
Mohanavel
+1  A: 

If this code is part of your project then the control should automatically appear in the toolbox after you compiled the code. But it is an option that might have been turned off. Tools + Options, Windows Forms Designer, General, Toolbox, AutoToolboxPopulate must be True.

If it is a separate assembly then Drag+Drop won't work. Right click the toolbox, Choose Items, use the Browse tab.

Hans Passant
@nobugz :Drag and Drop, Choose items from Browse options will work in the same way. Any way i got the answer by enabling ( AutoToolboxPopulate to True ),Enabling this property creating the new tab in the name of assembly and it adding the controls by itself while compiling. Still i couldn't add the controls to my own tab by either choose items from browse or Drag + Drop. Any way i got the solution. its doing well.But i don't know how its?
Mohanavel