I have a UserControl
that is dynamically added to a FlowLayoutPanel
. In that same UserControl
I have a button to remove itself if the user wants, obviously at runtime. I need to delete it from Form
. I tried this but nothing happened because the "Children" does not recognize me:
((FlowLayoutPanel)this.Parent).Children.Remove(this);