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

Intensive Loop, Update UI

Joe
Is there a function where I can use in a long intensive loop that would
allow the program to update the UI and allow some control of the UI.

I remember using this in VB but I was wondering if there's a function call
for C# to be used in a long loop.
Feb 5 '06 #1
2 2992
I would move that code to another thread.

But, in case you don't want to, the DoEvents method might do that same as
its VB counterpart.

"Joe" <jo*******@yahoo.com> wrote in message
news:u9**************@TK2MSFTNGP10.phx.gbl...
Is there a function where I can use in a long intensive loop that would
allow the program to update the UI and allow some control of the UI.

I remember using this in VB but I was wondering if there's a function call
for C# to be used in a long loop.

Feb 5 '06 #2
There's good information in the "Keeping your UI Responsive and the Dangers
of Application.DoEvents" blog entry linked below.
http://blogs.msdn.com/jfoscoding/arc...06/448560.aspx

As another poster has stated, the recommended way is to move to another
thread and Invoke
(http://blogs.msdn.com/jfoscoding/arc...26/422405.aspx) back to
the main UI thread if you need to make an update to a control.

--
Tim Wilson
..NET Compact Framework MVP

"Joe" <jo*******@yahoo.com> wrote in message
news:u9**************@TK2MSFTNGP10.phx.gbl...
Is there a function where I can use in a long intensive loop that would
allow the program to update the UI and allow some control of the UI.

I remember using this in VB but I was wondering if there's a function call
for C# to be used in a long loop.

Feb 6 '06 #3

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

Similar topics

0
by: Sue Adams | last post by:
I actually have two issues/questions: I have an autonumber field in an access db table that I grab and later use to update a record in another table withing the same db. The code I use to get...
11
by: rishi_israni | last post by:
Hi, i am having a strange problem running memory intensive queries on SQL server. I am doing an update on a table with 9 million records from another table with 50 records. the query i am...
0
by: Anthony Robinson | last post by:
I have a stored procedure that needs to loop through a record set, evaluate value, then either perform an operation or move tro the next record - depending on some criteria. Here's the procedure:...
0
by: Glenn Engelbart | last post by:
I am trying to find out a way to get more code re-use & object orientation in the UI portion of my apps. (There already is plenty of both in the DataAccess & Business Logic portion of my apps. ...
4
by: Chris Moltisanti | last post by:
Hi, I am executing a piece of javascript that does some intensive processing (sorting large tables). This can take a good few seconds so I have an animated gif as a progress bar to let the user...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
16
by: fniles | last post by:
I am using VB.NET 2003, SQL 2000, and SqlDataAdapter. For every record in tblA where colB = 'abc', I want to update the value in colA. In VB6, using ADO I can loop thru the recordset,set the...
3
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Here is my loop and it runs fine: ---------------------------------------------------- sSQL = "SELECT * FROM STORE_ITEMS" Set DataRec = DB.execute(sSQL) if not DataRec.EOF then do while not...
2
by: Kevin Walzer | last post by:
I'm trying to decide whether I need threads in my Tkinter application or not. My app is a front end to a command-line tool; it feeds commands to the command-line program, then reads its output and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.