-
How to use an Items Collection Editor on a custom UserControl (.Net 4, Winforms)?
I created a UserControl that contains a custom ToolStrip Control. While using the UserControl throughout an application, the ToolStrip control cannot be accessed directly, as logically it's embedded in the UserControl. So, to access the items of the ToolStrip I defined a readonly property in the UserControl class that returns the items of the ToolStrip. Now programmatically the items of the ToolStrip can be edited by using the UserControl.Items property, but I cannot do the same in the design mode. Like someone drags the UserControl from the ToolBox to the form, goes to the property grid, chooses the Items property and manipulates the items of the ingrained ToolStrip accordingly; just as we do with any standard ToolStrip control's items collection with the help of Items Collection Editor. Herein, though the Items property of the UserControl shows in the property grid, it's not usable and every time I click, it shows an error message- 'Value cannot be null. Parameter name: value'. I'm sure this is because the property is declared just as readonly and I need to hike more so that when it is clicked in the property grid, the Items Collection Editor pops up with the items of the ToolStrip and can be handled consequently. So how should I be doing this?
Please state if I'm not clear.
Regards!
Similar Threads
-
By YellowPanda in forum .NET
Replies: 3
Last Post: 01-16-2010, 01:09 AM
-
By Actipro Software Support in forum dotnet.announcements
Replies: 0
Last Post: 07-07-2003, 08:30 PM
-
By anonymous in forum VB Classic
Replies: 0
Last Post: 05-22-2002, 08:46 PM
-
Replies: 1
Last Post: 02-11-2002, 09:37 AM
-
By Tony Mancuso in forum VB Classic
Replies: 1
Last Post: 08-15-2001, 09:17 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks