473,804 Members | 3,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Add ToolStripItemCo llection 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:

[DesignerSeriali zer("System.Win dows.Forms.Desi gn.ToolStripCod eDomSerializer,
System.Design, Version=2.0.0.0 , Culture=neutral ,
PublicKeyToken= b03f5f7f11d50a3 a",
"System.Compone ntModel.Design. Serialization.C odeDomSerialize r,
System.Design, Version=2.0.0.0 , Culture=neutral ,
PublicKeyToken= b03f5f7f11d50a3 a")]

[Designer("Syste m.Windows.Forms .Design.ToolStr ipDesigner, System.Design,
Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a")]
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 3158

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1597
by: Vincent Finn | last post by:
Hi, I have a user control and I want an array of items to be available to the user In my case these items are a class called Needle. I added a property called Needles to get\set the array (Needle) and it seems to work except that the designer doesn't handle it correctly In the property page of the designer I see the property and I can
0
1454
by: Jordan Bowness | last post by:
I make a similar post in another newsgroup, but this example is simplified somewhat. I have a component (cmpMyComponent) with 2 properties. The 1st property is a string value (Description) and the 2nd property is a strongly typed collection class (myCollectionProperty). The collection contains a simple class (myCustomClass) which has 1 text property (TextProperty).
7
4452
by: Andrea Moro | last post by:
I'm writing my first windows control library. A simple textbox with some numeric facilities. Well, there is a strange thing that happen. I want to add a locked property. As many other property, because it's a default property, I must shadow it, but unfortunately, despite the other properties shadowed, for instance tabindex, locked continue to stay in design category also if I set it up to behaviour, and doesn't run my own code.
5
1949
by: RSH | last post by:
I havent been able to set a property from another class with out getting some sort of error. Can someone please tell me what I'm doing wrong here? Public Class Form1
2
3343
by: Michel Lapointe | last post by:
Hi, I have a problem while creating a customized DataGridViewColumn with a custom property. The problem is that after defining the property, adding the column to my Datagridview and settings it's property to true it never get define in the ..designer files, it always revert back to the default value. Does anyone know a fix to this issue/bug?
1
2999
by: screamingtarget | last post by:
I'm using C# 2.0. I have a UserControl-based class that contains a set of controls that are TextBox-based. The number of controls defaults to 1, but it is a browsable property (NumFields) in the form designer and can be changed. I expose a FieldText property in the form designer without exposing the TextBox-based class. I'm using an array of strings as the FieldText property. However the FieldText property as displayed in form...
3
4790
by: Barry | last post by:
A beginners question to someone that isn't a beginner ;) I've forgotton a lot. The code below isn't what I want to do but it demonstrates succinctly my problem. I want to drop a "MyTextBox" control on a form at design time, set the "DummyProperty" property to be "test value1", and I want to see it showing at design and runtime "test value1". It shows a blank. If I do this with the "Text" property it works but not with my "DummyProperty"...
4
2701
by: Mark Olbert | last post by:
I've written a composite custom control which I would like to have update its design-time display when one of several properties changes at design time. These custom properties are not simply the exposed properties of the constituent controls (e.g., they control how many constitutent controls are displayed). I am at a loss as to how to go about doing this. I have a custom designer for the control, but I don't see any functionality in the...
6
3346
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
Yesterday Visual Studio gave me a strange error both at compiletime and at designtime that had no obvious connection to anything I had changed recently. After some effort tracking down the problem I discovered first a workaround, then the real cause of the problem. I would like to understand why what I am doing is frowned upon by Visual Studio and how to do this properly. My application is in one solution; supporting libraries including...
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9587
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.