add a reference to system.Design.d ll
\\\\\\
Imports System.Componen tModel
Imports System.Componen tModel.Design
Imports System.Drawing. Design
Public Class MyTabControl
Inherits UserControl
'Windows Form Designer generated code
<Editor(GetType (TabPageCollect ionEditor), GetType(UITypeE ditor))> _
Public ReadOnly Property TabPages() As ControlCollecti on
Get
Return Controls
End Get
End Property
Friend Class TabPageCollecti onEditor
Inherits CollectionEdito r
Public Sub New(ByVal type As System.Type)
MyBase.new(type )
End Sub
Protected Overrides Function CreateCollectio nItemType() As System.Type
Return GetType(MyTabPa ge)
End Function
End Class
End Class
Public Class MyTabPage
Inherits ScrollableContr ol
'...
End class
//////
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Alon" <Al**@discussio ns.microsoft.co m> wrote in message
news:03******** *************** ***********@mic rosoft.com...
hi,
10X for the "CanParent" tip, i solved it through overriding the
"OnControlAdded " method. which is better way to do it ?
and regarding my base problem, i kind of got to the next phase - i now
have
a usercontrol of type "A" who can hold lots of usercontrols of type "B".
if
i drag the "A" and then drag the "B" into "A" i CAN add other controls to
"B". that was my initial meaning !!!
BUT, while this situation is ok, i rather want "A" to have a collection
property of "B"s (like tabcontrol with tabpages etc) with all "B"'s
properties.
this cause me 2 problems:
1) i understood i need a collection class and an item class and lots of
other stuff. is there a good article/code example anywhere about it ?
couldnt
find any that is really thorough... (Joey - i already saw the article you
attached, 10X a lot but this example do not really take care all the
aspects
i need, although when read it, i started to understand what is waiting for
me....:))
2) i kind of succeeded in doing something like a collection (simple
property
who makes on design time "B" and add it to "A") but then i couldnt see it
on
the "InitializeComp onent" methode of the main form, in other words - i
couldnt add to "B" other controls...
i figure that if problem 1 will be solved i wont be bothered by 2 but if
there's something to do on the meantime... :)
10X,
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004