Click here to Skip to main content
15,910,787 members
Home / Discussions / C#
   

C#

 
GeneralRe: Returning multiple values from methods Pin
Marc Clifton23-May-04 2:59
mvaMarc Clifton23-May-04 2:59 
GeneralRe: Returning multiple values from methods Pin
bjoernen23-May-04 5:43
bjoernen23-May-04 5:43 
GeneralRe: Returning multiple values from methods Pin
Heath Stewart23-May-04 3:59
protectorHeath Stewart23-May-04 3:59 
GeneralRe: Returning multiple values from methods Pin
leppie22-May-04 19:45
leppie22-May-04 19:45 
GeneralRe: Returning multiple values from methods Pin
Heath Stewart23-May-04 3:56
protectorHeath Stewart23-May-04 3:56 
GeneralRe: Returning multiple values from methods Pin
bjoernen23-May-04 6:03
bjoernen23-May-04 6:03 
GeneralRe: Returning multiple values from methods Pin
MilesAhead24-May-04 7:34
MilesAhead24-May-04 7:34 
GeneralCausing a time delay within a method Pin
Anonymous22-May-04 11:57
Anonymous22-May-04 11:57 
I am creating a memory game in C# that flashes a pattern on 4 buttons by changing the background images. Then the user repeats the pattern on the same buttons.

My problem is getting a delay to occur between the flashes. The Sleep delays between the calls of flash() seem to all pile up at the beginning of the loop. The last call of flash() is all i see occuring. I run this loop:

//IN Game class code
for(int i = 0; i < buttonTrack.Count; i++) {
flash((int)buttonTrack[i]);
System.Threading.Thread.Sleep(1000);
}

public void flash(int n){
// convert number to button
switch(n) {
case 1 :
form1.redB();
break;
case 2 :
form1.blueB();
break;
case 3 :
form1.yellowB();
break;
case 4 :
form1.greenB();
break;
}
}
//End Game class code

//In Form1 class code
public void redButton() {
button4.BackgroundImage = redOn;

button5.BackgroundImage = blueOff;
button6.BackgroundImage = yelOff;
button7.BackgroundImage = greenOff;
}

public void blueButton() {

//same idea as above
button5.BackgroundImage = blueOn;

button4.BackgroundImage = redOff;
button6.BackgroundImage = yelOff;
button7.BackgroundImage = greenOff;
//ditto for other color methods
}
//End Form1 class code
GeneralRe: Causing a time delay within a method Pin
bjoernen22-May-04 12:55
bjoernen22-May-04 12:55 
GeneralRe: Causing a time delay within a method Pin
Colin Angus Mackay22-May-04 12:56
Colin Angus Mackay22-May-04 12:56 
GeneralRe: Causing a time delay within a method Pin
Marc Clifton22-May-04 15:00
mvaMarc Clifton22-May-04 15:00 
GeneralStackFrame Pin
TuringTest122-May-04 11:16
TuringTest122-May-04 11:16 
GeneralRe: StackFrame Pin
Colin Angus Mackay22-May-04 13:03
Colin Angus Mackay22-May-04 13:03 
GeneralRe: StackFrame Pin
Marc Clifton22-May-04 15:11
mvaMarc Clifton22-May-04 15:11 
GeneralRe: StackFrame Pin
TuringTest122-May-04 16:33
TuringTest122-May-04 16:33 
GeneralRe: StackFrame Pin
leppie23-May-04 2:22
leppie23-May-04 2:22 
GeneralRe: StackFrame Pin
TuringTest123-May-04 10:47
TuringTest123-May-04 10:47 
GeneralRe: StackFrame Pin
Heath Stewart23-May-04 3:53
protectorHeath Stewart23-May-04 3:53 
GeneralFile size Pin
PaleyX22-May-04 8:31
PaleyX22-May-04 8:31 
GeneralRe: File size Pin
MyBlindy22-May-04 8:53
MyBlindy22-May-04 8:53 
GeneralRe: File size Pin
PaleyX22-May-04 13:31
PaleyX22-May-04 13:31 
GeneralRe: File size Pin
Member 93002222-May-04 8:59
Member 93002222-May-04 8:59 
GeneralRCW question when returning a string Pin
Nish Nishant22-May-04 3:33
sitebuilderNish Nishant22-May-04 3:33 
GeneralRe: RCW question when returning a string Pin
Heath Stewart22-May-04 3:49
protectorHeath Stewart22-May-04 3:49 
GeneralRe: RCW question when returning a string Pin
Nish Nishant22-May-04 3:58
sitebuilderNish Nishant22-May-04 3:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.