QuestionHelpbutton press loop

Posts 1–9 of 9 · Page 1 of 1
button press loop
is it possible to do something like:


Code:
    
         for(int i = 1 , i != 5 , i++)
{
         private void checkBox[i]_CheckedChanged(object sender, EventArgs e)
        {
            code...
        }
}
Only like this
Code:
{
         private void checkBox[i]_CheckedChanged(object sender, EventArgs e)
        {
            for(int i = 0 , i < 5 , i++)
            //code...
        }
}
Quote Originally Posted by Eidolon View Post
Only like this
Code:
{
         private void checkBox[i]_CheckedChanged(object sender, EventArgs e)
        {
            for(int i = 0 , i < 5 , i++)
            //code...
        }
}
ok thanks

i don't want to hardcode stuff so i can use those noob tips (i'm the noob, so the tip is meant for noobs, cause you're pro xD )

EDIT: hmmm doesn't work, does is still has to be triggered like something? cause that's not the meaning of it...
Quote Originally Posted by stevonator View Post
ok thanks

i don't want to hardcode stuff so i can use those noob tips (i'm the noob, so the tip is meant for noobs, cause you're pro xD )

EDIT: hmmm doesn't work, does is still has to be triggered like something? cause that's not the meaning of it...
Select all the checboxses
Go to the events and create the changedchanged event thing.
Do the event there.

Note: You need to think a little bit about how to do it.
It's not as easy as I make it sound :P
(I did this once, but then I used a loop for a check. As I showed you earlier in another thread...)
Quote Originally Posted by Jorndel View Post


Select all the checboxses
Go to the events and create the changedchanged event thing.
Do the event there.

Note: You need to think a little bit about how to do it.
It's not as easy as I make it sound :P
(I did this once, but then I used a loop for a check. As I showed you earlier in another thread...)
euhm.. ok xD

i'll try it day after tommorow, cause i can most of the time only play every 2 days :/
Code:
{
         private void checkBox[i]_CheckedChanged(object sender, EventArgs e)
        {
            //Initialize a temporary integer for the loop count. You loop 5 times. Thereafter you stop looping. it gets triggered by pressing the button
            for(int i = 0 , i < 5 , i++)
            //code...
        }
}
Well depends on what it will do

you have as shown:

Code:
for(int Integer = 0; Integer != 10; Integer++)
for = Doing something for...
int Integer = 0 = Creates an integer that holds the value 0
Integer != 10 = Will do the for aslong as Integer is NOT equal to 10
Integer++ = Increase the Integers value with one each time it finish the for (loop)

Code:
while(Value)
while = Do something while the value is not true/false
Value = the value it will use to check.

Like:
Code:
int i = 0;
while(i != 10)
i++;
Quote Originally Posted by Jorndel View Post
Code:
int i = 0;
while(i != 10)
i++;
.... Are you serious?
Code:
for(int i = 0; i < 10; i++)
Is just the same

Code:
char answer = 'y';
while(answer = 'y'){
cout << "Answer is yes" << endl;
cin >> answer;}
is more like a while
Quote Originally Posted by Eidolon View Post


.... Are you serious?
Code:
for(int i = 0; i < 10; i++)
Is just the same

Code:
char answer = 'y';
while(answer = 'y'){
cout << "Answer is yes" << endl;
cin >> answer;}
is more like a while
X,x
Seems you need to studdy a bit more on that :|
Was just an example on HOW he could use a while loop.
For all I care he can use a bool as the while value...

It's all about helping the user to understand what the code does.
And not just give them a code and say: Do that or put that there.
Then he would maybe have to ask us again for this in 4 weeks or so...

It's more about the user-focuse rather then the expertise of the answer. (That helps as well)
But having a noob telling you how to do it instead of a geek.
Some MIGHT not understand a geeky way but the nooby way is more on his level.

Or who ever that needs help.
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us