I'm trying to create a component that inherits from a ComBox. I created the component by following the steps below, the project is available at: link
- Without any open project > File > New > Project > Class Library (Visual C #) > Name: "Custom Components"
- Delete Class1.cs
- In the "Right click" project > Add ... > Component > Component Class (Visual C # Items) > Name: "ComboBoxEx"
- In References > Add Reference ... > Search for "Forms > Check System.Windows.Forms & OK"
- In the "code" change
Component
byComboBox
> add% with% > inusing System.Windows.Forms;
underpublic ComboBoxEx()
addInitializeComponent();
- Save and "build"
- In a WindowsFormsApplication project I right click on a tab of the "TollBox" > Choose Items ... > on the .NET Framework Components > I click Browse .. > I select "C: \ Program Files \ C # \ branches \ Repository \ HomeProducts \ Common Components \ bin \ Debug \ ComponentsProprios.dll"
This is when the message and error "There are no components in 'C: \ Programmer \ C # \ branches \ Repository \ Components \ OwnProfile \ bin \ Debug \ ComponentsProprios.dll' that is placed on the toolbox. / p>
BomboBoxEx class using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Text; using System.Windows.Forms;
namespace ComponentesProprios
{
public partial class ComboBoxEx : ComboBox
{
public ComboBoxEx()
{
DropDownStyle = ComboBoxStyle.DropDownList;
}
public ComboBoxEx(IContainer container)
{
container.Add(this);
}
}
}