How do I make components from other dlls accessible in the VS 2005 Toolbox?
I have the "Tools->Options->Windows Forms Designer->General->AutoToolboxPopulate" property in VS 2005 set to true.
I am referencing a DLL file with (public) custom components and forms in my project, but the components are not in the Toolbox. I tried adding them progra开发者_如何学Pythonmmatically in the "MyForm.Designer.cs" file, but that just messed up the designer.
Such an aggravating issue. Never been able to solve this. Does anyone know how to make these components appear in the Toolbox?
You need to add them to the toolbox manually. To do so, follow these steps:
Right-click on the toolbox, and select "Choose Items" from the context menu.
In the dialog that appears, make sure that the first tab (".NET Framework Components) is selected.
Click the "Browse" button near the bottom of the tab page.
Navigate to the DLL file that contains your custom controls/components, and open it.
Any accessible components should be added to the listbox, and automatically checked. If you want to choose specific components from the library to exclude, uncheck them now.
Click OK. All of the components that you selected should be added to the toolbox.
If/when you ever decide to remove those custom items from your toolbox, you can simply right-click on it, and select "Reset Toolbox" from the context menu. This will remove any items that you have added, and restore the contents of the toolbox to its default items.
精彩评论