In the code example below, does the RadioButton rb still exist in Form mainForm after the code leaves the using statement and rb is disposed?
using (var rb = new RadioButton())
{
rb.Text = "Test Radio Button";
rb.Checked = true;
mainForm.MyPanel.Controls.Add(rb);
}
It still exists as an object, but it may be trash, as you have Dispose
d it, once execution leaves that using
block.