Click here to Skip to main content
15,868,128 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everyone,

I just implemented a really simple ToolboxItem:
C#
private class MyToolboxItem : ToolboxItem
{
  public override string ComponentType
  {
    get { return "HTML Fragment"; }
  }

  public TcWebHmiToolboxItem(String name)
  {
    DisplayName = name;
    Description = "My first Toolbox item.";
  }
}


When I create few instances of it, the created items are not shown for specific document types, e.g. HTML documents. When I open a HTML file, for example "index.html", than the Toolbox is cleaned automatically and only the categories "HTML" and "General" are shown. For other file types, for example any *.cs file, the Toolbox shows a lot of Toolbox items, some are deactivated but most are activated.

There is no way for activating the Toolbox items manually, or to show specific categories manually.

My code for adding Toolbox items is:
C#
IToolboxService ts = GetService(typeof(IToolboxService)) as IToolboxService;
if (ts != null)
{
  ts.AddToolboxItem(new MyToolboxItem ("Hello world!"), "MyCategory");
}
ts.Refresh();


Do I need to implement some filter?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900