AlexCode Posted December 3, 2003 Posted December 3, 2003 Hi! I have a user control and one of its properties is a Collection. How do I manage this collection on the properties grid at design-time like I manage the tab pages of the tab control for example? I need to view that collection editor with all properties of the collection objects, add and remove items to the collection... etc... Thanks Alex :D Quote Software bugs are impossible to detect by anybody except the end user.
bpayne111 Posted December 5, 2003 Posted December 5, 2003 possibility divils article on a form designer will accomplish your task i believe http://www.divil.co.uk/net/ in the set block of the property you should check to see if in designmode and load the designer if so good luck brandon Quote i'm not lazy i'm just resting before i get tired.
AlexCode Posted December 5, 2003 Author Posted December 5, 2003 Divil has a very useful tuturial about SOME designers... But not the collection editor... :( Still wondering around for it... Thanx Alex :D Quote Software bugs are impossible to detect by anybody except the end user.
AlexCode Posted December 5, 2003 Author Posted December 5, 2003 Ok, I think I'm quite close to get it but I'm still having problems editing the Items and adding them into the collection... I have this: Public Class winMultiPage ... Dim _PagesColl As ArrayList <Editor(GetType(MYCollectionEditor), GetType(System.Drawing.Design.UITypeEditor))> _ Public Property PagesColl() As ArrayList Get Return _PagesColl End Get Set(ByVal Value As ArrayList) _PagesColl = Value End Set End Property ... End Class Friend Class MYCollectionEditor Inherits CollectionEditor Public Sub New() MyBase.New(GetType(winMultiPage)) End Sub Protected Overrides Function CreateCollectionItemType() As System.Type Return GetType(winPage) End Function End Class What happens with this code is that when I add an item in the CollectionEditor the Add & Remove buttons become desabled, and a still can't add that item to the collection... When I close the editor and reopen it again I don't get any object on the listbox but the PropertyGrid is filled with the properties like if an object was selected... Wierd :confused: Thanx Alex :D Quote Software bugs are impossible to detect by anybody except the end user.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.