Hello;-)
I just designed a simple "For Loop" using window form application. I would like that this will be only clickable once & that it will not repeat the same information if I click the button. How could I do that? thanks Here is my code:
int count;
for (count = 0; count < 5; count = count + 1)
{
listBox1.Items.Add("This is count: " + count);
}
const string textEnd = "Done!!!";
{
listBox1.Items.Add(textEnd);
}
==== Additional Info === I've made it this way now. This will only click once, but the button is still enable. I think this is ok:
int count;
for (count = 0; count < 5; count++)
{
string newItem = "This is count: " + count;
if (listBox1.Items.IndexOf(newItem) < 0)
{
listBox1.Items.Add(newItem);
}
}
const string textEnd = "Done!!!";
if (listBox1.Items.IndexOf(textEnd) <0)
{
listBox1.Items.Add(textEnd);
}