473,406 Members | 2,356 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,406 software developers and data experts.

when to use DoEvents in vb.net?

As I migrate my VB6 apps to vb.net I am checking what
features I need to retain from vb6. In vb6 I noticed that
DoEvents really made a performance difference when I
called it just before a Do/For loop for large datasets. I
hope do some multithreading in vb.net for this. But I am
not completely sure about how

System.Windows.Forms.Application.DoEvents()

works, or its application/purpose. Is this the same as
the DoEvents from vb6? Should I keep this feature in my
vb.net projects?

TIA,
Rich
Nov 20 '05 #1
3 20042
I can't say it any better than the documentation ;-)

"If you call DoEvents in your code, your application can handle the other
events. For example, if you have a form that adds data to a ListBox and add
DoEvents to your code, your form repaints when another window is dragged
over it. If you remove DoEvents from your code, your form will not repaint
until the click event handler of the button is finished executing.

"Typically, you use this method in a loop to process messages.
So the answer is, it depends. Do you want messages to be processed (such as
redrawing)? Or do you want to go for maximum performance and not do it?
--
Alex Papadimoulis
http://weblogs.asp.net/Alex_Papadimoulis
"Rich" <an*******@discussions.microsoft.com> wrote in message
news:1d*****************************@phx.gbl...
As I migrate my VB6 apps to vb.net I am checking what
features I need to retain from vb6. In vb6 I noticed that
DoEvents really made a performance difference when I
called it just before a Do/For loop for large datasets. I
hope do some multithreading in vb.net for this. But I am
not completely sure about how

System.Windows.Forms.Application.DoEvents()

works, or its application/purpose. Is this the same as
the DoEvents from vb6? Should I keep this feature in my
vb.net projects?

TIA,
Rich

Nov 20 '05 #2
* "Rich" <an*******@discussions.microsoft.com> scripsit:
As I migrate my VB6 apps to vb.net I am checking what
features I need to retain from vb6. In vb6 I noticed that
DoEvents really made a performance difference when I
called it just before a Do/For loop for large datasets. I
hope do some multithreading in vb.net for this. But I am
not completely sure about how

System.Windows.Forms.Application.DoEvents()

works, or its application/purpose. Is this the same as
the DoEvents from vb6? Should I keep this feature in my
vb.net projects?


There is no 'DoEvents' necessary if you put the dataset processing stuff
into a separate thread.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3
Thanks all for your replies. It sounds like

System.Windows.Forms.Application.DoEvents()

is the same as DoEvents from vb6. Just wanted to make
sure.
-----Original Message-----
As I migrate my VB6 apps to vb.net I am checking what
features I need to retain from vb6. In vb6 I noticed thatDoEvents really made a performance difference when I
called it just before a Do/For loop for large datasets. Ihope do some multithreading in vb.net for this. But I am
not completely sure about how

System.Windows.Forms.Application.DoEvents()

works, or its application/purpose. Is this the same as
the DoEvents from vb6? Should I keep this feature in my
vb.net projects?

TIA,
Rich
.

Nov 20 '05 #4

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

Similar topics

24
by: bazad | last post by:
Hi, I'd like to understand consequences of Application.DoEvents call. Does it create a new thread? Thank you
3
by: Chuck Reed | last post by:
I have a MS Access data base that creates custom reports for clients in PDF form then prints the reports after all client's reports have been printed. The problem that I have run into is that when...
8
by: Tony | last post by:
Just starting C# from a VB background. Is there a C# keyword comparable to the vb keyword DoEvents? Tony!
3
by: dotNETDavid | last post by:
We've broken our app into various assemblies. The WinForm assembly provides the user interface, other assemblies provide various I/O services. I'd like to be able to call...
6
by: Ollie Riches | last post by:
I understand the use of Application.DoEvents() to process all outstanding messages on the message queue in a winforms application if you have long running process on the UI thread. But can anyone...
17
by: Lance | last post by:
I've noticed that calling DoEvents is much slower in an application that has called Application.EnableVisualStyles in Sub Main. Furthermore, the performance seems to worsen each time that DoEvents...
12
by: Jack Russell | last post by:
My unstanding of all VB up to and including vb6 is that an event could not "interrupt" itself. For instance if you had a timer event containing a msgbox then you would only get one message. ...
12
by: Justin | last post by:
I can attach my code if anyone wants to see it however I'll try to ask my question with some mark up code first. I'm having a problem terminating my process while using DoEvents. For example: ...
11
by: Don | last post by:
I have a WPF application in VB in VSTS 2008 RTM. I am trying to "blink" (momentarily clear) a field of data if the data is reloaded from the database to give the user some visual indication of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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.