473,396 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

doing other things while the program in loop

I want to show the number on the screen, while the program is in loop, at
real time...

But the program shows the number after loop ends... My program do nothing
before loop ends...

How can I prevent this? I don't want my program to stall while it is in
loop...

Thank you...
Nov 15 '05 #1
2 1100
2003et <e1*****@metu.edu.tr> wrote:
I want to show the number on the screen, while the program is in loop, at
real time...

But the program shows the number after loop ends... My program do nothing
before loop ends...

How can I prevent this? I don't want my program to stall while it is in
loop...


You should put the work loop in another thread, and update the UI
periodically. However, you should use Control.Invoke to make sure that
you don't actually make the change to the UI from the worker thread -
you should only ever modify the UI from the UI's own thread.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
Another way to do this is by using Asynchronous callbacks.

http://msdn.microsoft.com/library/de...rnoverview.asp

"2003et" <e1*****@metu.edu.tr> wrote in message
news:uy**************@TK2MSFTNGP10.phx.gbl...
I want to show the number on the screen, while the program is in loop, at
real time...

But the program shows the number after loop ends... My program do nothing
before loop ends...

How can I prevent this? I don't want my program to stall while it is in
loop...

Thank you...

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jon Perez | last post by:
When you run an empty while loop under Python , it slows down the rest of the system. Is this normal? And should it be something that needs to be corrected?
6
by: xeys_00 | last post by:
I'm trying to use the character "q" to exit this program. But if anything but q is input , I want the loop to continue. Am I using the wrong loop? #include <string> #include <iostream> ...
3
by: Michel Rouzic | last post by:
I got a loop checking if the system time has took one more second or not since last iteration, works nicely, but it uses the whole CPU. I've read many previous topics on c.l.c about wait() type...
8
by: koorb | last post by:
I am starting a program from a module with the Sub main procedure and I want it to display two forms for the program's interface, but when I run the program both forms just open and then program...
5
by: ken | last post by:
Hi, I have two questions the first is: in the example below how can I call an event from within a statement, such as replace Stop1 with cmdStop1 which is a button on my form? My second question...
10
by: Enkidu | last post by:
Beginner question, sorry! I am using indexers to access an array of StringBuilders in an instance of a class: Getting: value = board1; Setting: board1 = value1 ;
41
by: c | last post by:
Hi every one, Me and my Cousin were talking about C and C#, I love C and he loves C#..and were talking C is ...blah blah...C# is Blah Blah ...etc and then we decided to write a program that...
16
by: raylopez99 | last post by:
I am running out of printing paper trying to debug this...it has to be trivial, but I cannot figure it out--can you? Why am I not printing text, but just the initial string "howdy"? On the...
6
by: r035198x | last post by:
I have put together this article to give people starting Swing an awareness of issues that need to be considered when creating a Swing application. Most of the Swing tutorials that I have seen just...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.