471,599 Members | 1,096 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,599 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 2950
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Sue Adams | last post: by
reply views Thread by Anthony Robinson | last post: by
16 posts views Thread by fniles | last post: by
3 posts views Thread by =?Utf-8?B?VmFuZXNzYQ==?= | last post: by
2 posts views Thread by Kevin Walzer | last post: by
2 posts views Thread by XIAOLAOHU | last post: by

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.