Quote Originally Posted by Simonetos The Greek View Post
So I ended up on this...
Code:
Private Sub Me_ParentChanged(sender As Object, e As EventArgs) Handles Me.ParentChanged
        If Me.ParentForm IsNot Nothing Then
            Dim _UserControl = DirectCast(Me.ParentForm, Control)
            If _UserControl IsNot Nothing Then
                Do Until _UserControl Is Nothing
                    If TypeOf _UserControl Is CmosTitleBar AndAlso _UserControl IsNot Me Then
                        Throw New ArgumentOutOfRangeException("", "You can place only one " & _UserControl.Name & " control per form.")
                    End If
                    _UserControl = _UserControl.GetNextControl(_UserControl, True)
                Loop
            End If
        End If
    End Sub
This is incorrect : _UserControl = _UserControl.GetNextControl(_UserControl, True)
... it will only go into controls... look @ my first example...