programatically creating control instances
-
Hi, yeah I need to know how to create an instance of a control programatically. I know one can do soemthing like "TextBox tb = new TextBox();" but this has to be done in the initialization section fo the class, and if it's written within a method, it's only available for within that method. But this isn't the main problem, the main thing is that I don't necessarily know how many of a certain control will be needed, so how do I create new control on demand with a name either generated, or taken from user input via a textbox or something? Thanks, Stephen
-
Hi, yeah I need to know how to create an instance of a control programatically. I know one can do soemthing like "TextBox tb = new TextBox();" but this has to be done in the initialization section fo the class, and if it's written within a method, it's only available for within that method. But this isn't the main problem, the main thing is that I don't necessarily know how many of a certain control will be needed, so how do I create new control on demand with a name either generated, or taken from user input via a textbox or something? Thanks, Stephen
-
This article doesn't work. I think something between vs '03 and vs '05 has changed. It wants me to create a ButtonArray, which does not exist. Here is what they have in the example:
// Declare a new ButtonArray object. ButtonArray MyControlArray; MyControlArray = new ButtonArray(this); // Call the AddNewButton method of MyControlArray. MyControlArray.AddNewButton();
Well seeing how the ButtonArray thing doesn't exist, I can't really do anything with this. How do I go about creating control collections in visual studio 2005?