[visual Basic, 2019]
Hello all.
I'm new to this forum, so smack me, if I do something stupid.
I have made a control, that I don't want to be a parent to other controls of its own class.
I know how to do this at runtime, but not how to achieve this during designTime.
By adding a ParentDesigner with the Function CanbeParentedto(), I can stop controls being dragged on my control from the form.
(a forbid-icon appears, and the dragged control is not added to my control)
But controls dropped from the Toolbox, are still being parented.
How can I prevent this?
Thank in advance for any suggestions...
Quote Reply
Report Bookmark
Hello all.
I'm new to this forum, so smack me, if I do something stupid.
I have made a control, that I don't want to be a parent to other controls of its own class.
I know how to do this at runtime, but not how to achieve this during designTime.
By adding a ParentDesigner with the Function CanbeParentedto(), I can stop controls being dragged on my control from the form.
Code:
Public Overrides Function CanbeParentedto(ByVal parentDesigner As IDesigner) As Boolean
If (TypeOf parentDesigner.Component Is MainFrame) Then
Return False
ElseIf (TypeOf parentDesigner.Component Is Frame) Then
Return False
End If
Return True
End Function
But controls dropped from the Toolbox, are still being parented.
How can I prevent this?
Thank in advance for any suggestions...
Quote Reply
Report Bookmark