
Signature
Mick Doherty
http://dotnetrix.co.uk/nothing.html
Thank you,
That has taken me one step closer. As far as I can tell, only a single
step remians.
(Continuing on with my previous exmpale...)
That definantly solved my problem, now the designer simply adds the
'tabs' to the control collection, but now when, in the designer, I
click the elipse button to open up the collection editor, it assumes
that I am adding Controls to the collection, not TabPages. Is there a
simple fix for this, or does this make everything a lot more
complicated?
Brian
> Public Readonly Property SomeCollection() As ControlCollection
> Get()
[quoted text clipped - 24 lines]
> > Thanks in advance for any help,
> > Brian
Mick Doherty - 06 Oct 2006 15:37 GMT
That's why I pointed you to the PanelManager source which very likely
implements all the methods that you may need.
You just need a custom CollectionEditor, which you associate to the property
via the EditorAttribute. You will need to add a reference to
System.Design.dll in order to use the CollectionEditor.
Imports System.ComponentModel
Imports System.Drawing.Design
Imports System.ComponentModel.Design
Public Class MyControl
...
<Editor(GetType(ButtonCollectionEditor), GetType(UITypeEditor))> _
Public ReadOnly Property Buttons() As ControlCollection
Get
Return MyBase.Controls
End Get
End Property
Private Class ButtonCollectionEditor
Inherits CollectionEditor
Public Sub New(ByVal type As Type)
MyBase.New(type)
End Sub
Protected Overrides Function CreateCollectionItemType() As System.Type
Return GetType(Button)
End Function
End Class
...
End Class

Signature
Mick Doherty
http://dotnetrix.co.uk/nothing.html
> Thank you,
> That has taken me one step closer. As far as I can tell, only a single
[quoted text clipped - 38 lines]
>> > Thanks in advance for any help,
>> > Brian