Hello,
First of all, I am an amateur programmer.
You know how the C# environment automatically names the first button you drag into the form as button1? Then when you drag another, it names it button2. I am not talking about the text, but the NAME. So this has no specified limit. My question is, how do I do that from the program? So each time I click a button, a new button should be created. If I click the button 5 times, 5 buttons should be created. As each one needs a unique name, an incrementing integer at the end would be perfect, like this:
namespace Duplicate { public partial class Form1 : Form { int c = 1; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { c++; ///Of course, this does not work: Button "button"+ c = new Button(); } } }
Can we do something like that, at least something quite near?
Thanks in advance,
Aadi B.