Change parental controls at runtime VB.NET

I am creating a custom drag and drop control and it is semi-transparent. I need it to move (mousemove event) if it crosses a control that its parent becomes that control. I tried to reprogram all controls and if control.bounds.intersectswith me.clientrectangle then me.parent = control type

, but it didn't work. Any help would be greatly appreciated.

+2


source to share


1 answer


Since you have links to both the parent and the new parent, follow these steps:



OriginalParent.controls.remove(YourControl)

NewParent.controls.add(YourControl)

      

+4


source







All Articles