Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I'm creating a custom windows form control in VS2010. I dragged and droped a toolstrip to my custom control. All I want to be able to do is make the toolstrip1.Items Editable from the designer.

I gave access to the toolstrip by adding a property.

public ToolStrip ToolStrip
{
get
{
return toolStrip1;
}
set
{
toolStrip1 = value;
}
}

Which works and when I edit the items it appears but it does not save it to my
.Designer.cs so when I run or reload the projects altho the "toolstripbuttons" are
added they are not linked to my toolstrip

The code I need to apear in my .Designer.cs class would be example:
this.CustomControl1.ToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[]{this.toolStripLabel1});

But I have no idea of how to make this happen.


So to sum up I would just like my toolBox inside my usercontrol to work exaclty like a normal toolstrip would in designer. Where You can edit the Items property

Any help would be appriciated.

Thx
Rousseau
Posted
Updated 28-Feb-12 2:02am
v2
Comments
Sergey Alexandrovich Kryukov 1-Mar-12 0:37am    
What, no platform, language, application type, UI library. Yes, it looks like C#, so what?
--SA
Member 8023568 1-Mar-12 3:48am    
Apologies I’m working in Visual Studio 2010, C#, .NET Framework 4 and I’m working in a Class Library.

I would just like to create my own control that behaves like a toolstrip. And allow me to edit the toolstrip “Items” in designer.

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