.NET 2
// dynamic textbox adding myTextBox = new TextBox(); this.Controls.Add(myTextBox); // ... some code, finally // dynamic textbox rem
Further Information on Compact Framework 2 + VS2005 Designer may crash when removing a control which is derived from s.w.f.control, if it doesn't implement the following:
Dispose() { if(this.parent!=null){ this.parent.controls.remove(this); } .... }