njsokalski
Well-known member
- Joined
- Mar 16, 2011
- Messages
- 102
- Programming Experience
- 5-10
I currently have the following code in my app:
System.Diagnostics.Debug.WriteLine(String.Format("Me.Parent: {0}", Me.Parent Is Nothing))
CType(Me.Parent, StackPanel).Children.Remove(Me)
System.Diagnostics.Debug.WriteLine(String.Format("Me.Parent: {0}", Me.Parent Is Nothing))
Which gives the following output:
Me.Parent: False
Me.Parent: True
If I comment out the Remove statement, I get
Me.Parent: False
Me.Parent: False
Which obviously means that removing one of the children is causing the parent to become Nothing. Why is removing from a Children collection making the parent Nothing? Any help would be appreciated. Thanks.
System.Diagnostics.Debug.WriteLine(String.Format("Me.Parent: {0}", Me.Parent Is Nothing))
CType(Me.Parent, StackPanel).Children.Remove(Me)
System.Diagnostics.Debug.WriteLine(String.Format("Me.Parent: {0}", Me.Parent Is Nothing))
Which gives the following output:
Me.Parent: False
Me.Parent: True
If I comment out the Remove statement, I get
Me.Parent: False
Me.Parent: False
Which obviously means that removing one of the children is causing the parent to become Nothing. Why is removing from a Children collection making the parent Nothing? Any help would be appreciated. Thanks.