I created my own control class by overriding the main controls that is.
[ToolboxData("<{0}:TextBox runat=server></{0}:TextBox>")] public class MyTextBox:System.Web.UI.WebControls.TextBox { public string myProperty {get;set;} }
Now for ease of use, what I am doing is adding these overridden controls to the Visual Studio ToolBox window.
For this, I just do it.
- Add a new tab to the ToolBox by right-clicking and "Add Tab"
- and then I do "Select Items" (right-click) and point to the DLL of my control class.
All the controls that I redefined, that is, TextBox, Button, Label appear there with a new name and icon. All I have to do is drag them and use them.
Now, is there a way for my controls to load automatically? I mean, I do not want to take the above two steps.
Here is what I did.
Added add-in and in her Exec, did it
public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled) { handled = false; if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault) { if(commandName == "testAddin.Connect.testAddin") { handled = true; ToolBox tlBox = _applicationObject.ToolWindows.ToolBox; ToolBoxTab tlBoxTab = null; tlBoxTab = tlBox.ToolBoxTabs.Add("Test Controls"); tlBoxTab.Activate(); tlBoxTab.ToolBoxItems.Add("TestControls", @"C:\testLib.dll", vsToolBoxItemFormat.vsToolBoxItemFormatDotNETComponent);
... but nothing happened. The "Test Controls" tab was there, but without control. When I try to do the same with System.Configuration.Install.dll (located in the [root] /Windows/Microsoft.Net/Framework/ [dotnetVersion] / folder)) .. the controls load fine .. but not when indicated my custom dll.
Please help me. I want to add these controls every time the IDE is launched (e.g. telerik controls). new to this extensibility project. Type Visual Studio ..
please, help....
user1186860
source share