Pausing A Loop in Windows Application
-
Good Day Sir/Maam, I am making a program to SIMULATE different sorting algrothims such as bubble sort, insertion sort, straight sort and quick sort. This program is for EDUCATIONAL PURPOSES. (EG: Show students how the algorithim works) The setup was, the program will ask the user for the LIST SIZE (Array Size), then the program will ask the values for the array then it will sort the array. I used a list view to show a table of VARIABLES and the LIST. (Like high school simulation) :) The problem is, I need to "pause" the loop on every pass. Like in a console app, I put getch() to pause the loop on every pass. What I want is, after each pass, the LOOP will pause, and there is a command button that needs to be clicked to continue the loop again for 1 pass. Then pause again. I hope I did not confused you with my english. :( Thank you great masters. :D
-
Good Day Sir/Maam, I am making a program to SIMULATE different sorting algrothims such as bubble sort, insertion sort, straight sort and quick sort. This program is for EDUCATIONAL PURPOSES. (EG: Show students how the algorithim works) The setup was, the program will ask the user for the LIST SIZE (Array Size), then the program will ask the values for the array then it will sort the array. I used a list view to show a table of VARIABLES and the LIST. (Like high school simulation) :) The problem is, I need to "pause" the loop on every pass. Like in a console app, I put getch() to pause the loop on every pass. What I want is, after each pass, the LOOP will pause, and there is a command button that needs to be clicked to continue the loop again for 1 pass. Then pause again. I hope I did not confused you with my english. :( Thank you great masters. :D
You can use a message box instead. :rose:
-
You can use a message box instead. :rose:
-
Good Day Sir/Maam, I am making a program to SIMULATE different sorting algrothims such as bubble sort, insertion sort, straight sort and quick sort. This program is for EDUCATIONAL PURPOSES. (EG: Show students how the algorithim works) The setup was, the program will ask the user for the LIST SIZE (Array Size), then the program will ask the values for the array then it will sort the array. I used a list view to show a table of VARIABLES and the LIST. (Like high school simulation) :) The problem is, I need to "pause" the loop on every pass. Like in a console app, I put getch() to pause the loop on every pass. What I want is, after each pass, the LOOP will pause, and there is a command button that needs to be clicked to continue the loop again for 1 pass. Then pause again. I hope I did not confused you with my english. :( Thank you great masters. :D
Use a ManualResetEvent that is triggered by the button click
only two letters away from being an asset
-
Good Day Sir/Maam, I am making a program to SIMULATE different sorting algrothims such as bubble sort, insertion sort, straight sort and quick sort. This program is for EDUCATIONAL PURPOSES. (EG: Show students how the algorithim works) The setup was, the program will ask the user for the LIST SIZE (Array Size), then the program will ask the values for the array then it will sort the array. I used a list view to show a table of VARIABLES and the LIST. (Like high school simulation) :) The problem is, I need to "pause" the loop on every pass. Like in a console app, I put getch() to pause the loop on every pass. What I want is, after each pass, the LOOP will pause, and there is a command button that needs to be clicked to continue the loop again for 1 pass. Then pause again. I hope I did not confused you with my english. :( Thank you great masters. :D
-
Good Day Sir/Maam, I am making a program to SIMULATE different sorting algrothims such as bubble sort, insertion sort, straight sort and quick sort. This program is for EDUCATIONAL PURPOSES. (EG: Show students how the algorithim works) The setup was, the program will ask the user for the LIST SIZE (Array Size), then the program will ask the values for the array then it will sort the array. I used a list view to show a table of VARIABLES and the LIST. (Like high school simulation) :) The problem is, I need to "pause" the loop on every pass. Like in a console app, I put getch() to pause the loop on every pass. What I want is, after each pass, the LOOP will pause, and there is a command button that needs to be clicked to continue the loop again for 1 pass. Then pause again. I hope I did not confused you with my english. :( Thank you great masters. :D
You asked this question 2 days ago. People answered you in that post - if you have problems with the solutions that people presented then, you should have the courtesy to reply to them on THAT post.
Deja View - the feeling that you've seen this post before.
-
Use a ManualResetEvent that is triggered by the button click
only two letters away from being an asset
-
http://msdn2.microsoft.com/en-us/library/system.threading.manualresetevent.aspx[^]
only two letters away from being an asset