I want to add my custom control into the VS Toolbox. But I need it to appear in toolbox always when a new project is open. How can I do that?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Create a VSIX package to install the control
You can create a VSIX package to distribute and install user controls to toolbox.
To do so, you can create a VSIX Project and add a Windows Forms ToolBox Control to the project. The control is decorated with a
ProvideToolboxControl
attribute which determines the tab that the control will appear in. You can pass an existing or a new tab name to the attribute:You can also fill the information in
.vsixmanifest
file. Then when you build the project, it creates a.vsix
package file in\bin\debug
folder of the project which you can distribute this file. If you run the file, it installs the control in visual studio toolbox.More information:
Note:
Manually Add Control to Toolbox
You can copy the dll of your control to a permanent location. Then right click on ToolBox, for example on general tab, then click
Choose Items ...
then in Choose Toolbox Items window in.Net Framework Components
Tab, clickBrowse...
button and open the dll of your control. Then in the components list, check the control and clickOK
button. The control will appear under the selected tab. You also can add your own tab simply by right click and chooseAdd Tab
.