473,498 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pause

Hi, Ive got a text box on a form and my program collect values. When
its running id like it to update my text box after each 50 values. How
do I get the program to pause, update the textbox then continue. I can
do the count ok, and get the values it doesnt update the textbox
though. I using if( x - y == 50) textbox = etc.
Regards Robert

May 23 '06 #1
3 1485
In a tight loop (which it sounds like you are) the nasty way is to call
Application.DoEvents(); after each 50.

This gets the job done, but isn't really nice; a better (but more complex)
way involves using a background thread and eventing, or a background worker
component (which does the same under the bonnet).

Marc
May 23 '06 #2
Thanks for a quick response, Ill have a read up on background threads.
Regards Robert

May 23 '06 #3
Fair enough...

Also - I kinda assumed in your original post that the textbox itself wasn't
the problem; using the grungy DoEvents() approach, this would look something
like:

int counter = 0;
while(someLoopCondition) {
DoSomethingInteresting();
counter++;
if(counter % 50 == 0) {
someTextBox.Text = counter.ToString();
Application.DoEvents(); // hate hate hate
}
}

Marc
May 23 '06 #4

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

Similar topics

0
1850
by: Andrew | last post by:
When will .NET have a low-pause-time garbage collector A low-pause-time garbage collector would greatly improve .NET's ability to serve as a platform for soft real-time systems. It doesn't have...
5
4107
by: Brian.Steele | last post by:
Greetings everyone. See http://www.spiceisle.com/cgi-bin/slideshow/slideshow.cgi?dir=brian/personal/2005/uk_trip/images&type=jpg The "Pause" button works in IE, but not in Firefox. Any ideas...
11
39849
by: Paminu | last post by:
Is there something like system("PAUSE") for linux?
8
36397
by: Wim | last post by:
My GUI application starts a process (a console program) when the user hits Play. I would like to add an option to pause that process. The code I've added to detect if the user hit pause/unpause...
38
3960
by: Jackie | last post by:
I just want the programme to stop for a while. Thanks.
2
2257
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Is there a way to start, pause and resume a recurrsive search exactly where you left off, say in the registry programmatically? -- Michael Bragg,...
6
4028
by: Peted | last post by:
Hi wondering what is the best way to do this Need a user to click a button, that sends 3 or 4 string based commands via a TCP/ip socket link I can connect to the ip device no problems, am...
8
11379
by: Lloydm | last post by:
I've used the command "pause" in batch files which works ok but I guess it's applied dirrently in c++. Using Dev C++ 4.0 and the following is my code #include<iostream> #include<iomanip>...
3
2591
by: garfunkel214 | last post by:
I have images and text rotating every 7000 ms using a setInterval. i am trying to implement a pause button that will stop the rotation when clicked. When clicked once more, I would like the rotation...
2
2608
by: bmerlover | last post by:
How do I use a PAUSE in .NET Framework using C++ (Visual Studio .NET 2003). I know it's system("pause") in the dos version. But I don't know what it is in the GUI version. I tried...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7004
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
7167
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7208
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...
1
6890
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...
1
4915
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...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
292
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.