Ok, not sure if this is possible or not, but I can't figure out how to get this working if it is. First, some quick code to show what I want to do:
Code:
public void DeleteControl(int controlnumber) {
this.Controls.Remove(this.textbox + controlnumber);
}
I know the code above won't work, but it should give a rough idea of what I want to do. I want to be able to pass say 4 to that function, and have control named "textbox4" be removed. How do I transform the contents of a variable into the proper type for the controls part to see it as vaild and remove textbox4?