471,570 Members | 927 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 software developers and data experts.

Add ToolStripItemCollection property to designer

Hi, ive got a custom control, it basically has a label and a toolstrip.
i can add my control to the toolbox and add it to a form, but i'd really
like to be able to let the end developer add items to the toolstrip via
the properties panel. Ive add a public property "ToolStripItems" to my
control and it shows up in the designer, but when i click the "..."
button to edit the collection i get the following dialog:
"Value cannot be null.
Parameter name: value"
Ive looked at the ToolStrip item class and notice it uses some design
time serialisation:

[DesignerSerializer("System.Windows.Forms.Design.To olStripCodeDomSerializer,
System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a",
"System.ComponentModel.Design.Serialization.CodeDo mSerializer,
System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a")]

[Designer("System.Windows.Forms.Design.ToolStripDes igner, System.Design,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
I tried adding these in to my class but it wont compile - complaining it
cant convert <mycontrol> to System.Windows.Forms.ToolStrip.

Any help on how i go about this?

Thanks,
Jan 19 '06 #1
0 3092

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Andrea Moro | last post: by
2 posts views Thread by Michel Lapointe | last post: by
1 post views Thread by screamingtarget | last post: by
4 posts views Thread by Mark Olbert | last post: by
6 posts views Thread by =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.