When adding controls to a form at runtime, you can do either of the following:
Button btn = new Button();
//...
this.Controls.Add(btn);
or
Button x = new Button();
//...
btn.Parent = this;
I had assumed that they were the same, and it was just down to personal preference which way to do it, but someone at work mentioned that the second method is worse as the button will not get disposed when the form is disposed (assuming no event handlers have been added and are being held onto).
This didn't make a lot of sense to me so I had a look online, but couldn't find anything to say one way or the other.
Does someone know the answer or can point me in the right direction?