473,385 Members | 1,901 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,385 software developers and data experts.

Can I pause without starting in a thread (in a forever loop)?

I need to know what the safest way to loop(without starting off in a
new thread since UI controls are involved) is...and how to
pause in the loop so that the program runs normally.
Any help is appreciated.
Thanks,
Trint

Nov 17 '05 #1
2 1184
trint <tr***********@gmail.com> wrote:
I need to know what the safest way to loop(without starting off in a
new thread since UI controls are involved) is...and how to
pause in the loop so that the program runs normally.


Unless your code is pretty much *purely* UI calls, you should use a
thread, and use Control.Invoke to marshall calls back to the UI when
you need to.

If you really are doing a huge amount of work that's just UI calls, you
could use Application.DoEvents, but personally I'd try to avoid that
and use another thread.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2
Jon,
I am making mostly calls to controls and each loop will open, read and
close sql server 2000 4 times. I wish that I felt more comfortable
with threads, which are great for non UI calls, that use
control.invoke.
Any ideas?
Thanks,
Trint

Nov 17 '05 #3

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

Similar topics

1
by: Sokar | last post by:
Hello, I was wondering if anyone could help me out. I have devised a wee menu system with 5 options. the way to select an option is to select a number 1 - 5 and then there is a switch block to...
3
by: cs_hart | last post by:
Is it possible to access excel worksheets without starting the excel application? If it makes any difference I'm running vb.net 2003 and excel 97. thanks...charlie
11
by: gilbert | last post by:
Hello! I am writing an application that would like to make use of a thread message queue, like the one provided in MFC. In MFC, the message poster calls the function PostThreadMessage. The...
43
by: dev_cool | last post by:
Hello friends, I'm a beginner in C programming. One of my friends asked me to write a program in C.The purpose of the program is print 1 to n without any conditional statement, loop or jump. ...
3
by: stmfc | last post by:
how can a multithreaded code can be compiled succesfully without importing Thread class? the example below is taken from marcus green mock exam 1: public class Rpcraven{ public static void...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.