Items Collection Editor, custom item doesn't show up

B

buzzweetman

I create:
public class MyToolStripButton : ToolStripButton

I put the attribute over it:
[ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip)]
public class MyToolStripButton : ToolStripButton

I drag a ToolStrip onto an empty form.
I select it and edit its Items Collection property, and up comes the
"Items Collection Editor" dialog.
In the combo box for "Select item and add to list below:",
MyToolStripButton appears!
Perfect!

Now the problem:
I create my own user control:
public class MyUserControl : UserControl

I drag a ToolStrip into this new user control.
I then make a property for the tool strip in the MyUserControl class:
public ToolStrip ExposedToolStrip
{
get
{
return this.toolStrip1;
}
}

I build everything.
Using the designer, I drag a MyUserControl to my form.
I select it and find the property ExposedToolStrip.
Looking into its heirarchy, I find its Items Collection and edit it.
Up comes the "Items Collection Editor" dialog.
But in the combo box for "Select item and add to list below:", there is
no MyToolStripButton!
Why didn't it show up?

By nesting the ToolStrip into a CustomControl, I lose the availability
of my custom ToolStripButton. What am I not understanding?

Thanks for any help.
Buzz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top