Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Click to for increment

Status
Not open for further replies.

pjsatif

IS-IT--Management
May 31, 2007
9
0
0
DE
Hi ppl,

I need to increment a FOR cicle for every click on a button. something like:

if(buttonNextStep.Click)
continue;


Anyone could help me?

Many thanks
 
i'm confused - what are they clicking on? What are they doing when the click?

I have a feeling you are used to scripting languages and not object oriented and event oriented languages.

 
No, I just need to continue a for cicle when a button on GUI is pressed.
The question is that I've multiple result to display in a textBox one by one, so the click in the button will display the next value (due the next for cicle interaction) until the array with result are empty.

 
Right, but C# is event driven.

Create a list of results and an index to specify where in the list you currently are.

Then capture the click event and move to the next item in the list. This is the object oriented model.

private void btnNext_Click(object Sender, EventArgs e)
{
txtResults.Text = myresultlist[index].ToString();
}

 
Ok, will work on that way... but I'm just trying to invert scene (integrating the event, not the function). Thanks for your tip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top