Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi,

i used AddLinkedToolBoxItem() function to add my toolbox item. i want to add more than one items at the same time. but my RootDesigner cannot add all of them. it only adds the last item.

Here is my code:

 

private void OnLoadComplete(object sender, EventArgs e)

{

IDesignerHost host = (IDesignerHost)sender;

host.LoadComplete -= new EventHandler(this.OnLoadComplete);

 

IToolboxService tbx = (IToolboxService)GetService(typeof(IToolboxService));

if (tbx != null)

{

ToolboxItem item1 = new ToolboxItem();

ToolboxItem item2 = new ToolboxItem();

 

item1.TypeName = "ValidationLibrary.NumberValidator" ;

item1.DisplayName = "NumberValidator";

item2.TypeName = "ValidationLibrary.StringValidator" ;

item2.DisplayName = "StringValidator";

 

 

item1.Lock();

tbx.AddLinkedToolboxItem(item1, "Validator", host);

item2.Lock();

tbx.AddLinkedToolboxItem(item2,"Validator", host);

}

 

 

Is there anything wrong?

Thanks

Posted

hi,

i want my toolbox items appeared only when my root designer is active.

When i used AddToolboxItem() method, items are appeared with all project items in the same project.

i want to use toolbox items as the way xml schema do.

 

thanks.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...