By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,769 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,769 IT Pros & Developers. It's quick & easy.

doevent

P: n/a
what is the alternate command of DoEvent in vb.net

lal
Nov 21 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Application.DoEvents

But only if you really need to. DoEvents is a VB thing, and only included in
VB.NET for compatability.

Best Regards,
Phil Harvey
--------------------
http://spaces.msn.com/members/dotnetspace
Nov 21 '05 #2

P: n/a
Application.DoEvents
"Lal - Luxor" <kr****@luxoroffice.com> escribió en el mensaje
news:el**************@TK2MSFTNGP12.phx.gbl...
what is the alternate command of DoEvent in vb.net

lal

Nov 21 '05 #3

P: n/a
"Lal - Luxor" <kr****@luxoroffice.com> schrieb:
what is the alternate command of DoEvent in vb.net


'Application.DoEvents'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #4

P: n/a
Phil,

If that were true then DoEvents would be part of the visual basic
compatibility namespace and the help files would not give an example of using
doevents in C#.

Kerry Moorman

"Phil Harvey" wrote:

But only if you really need to. DoEvents is a VB thing, and only included in
VB.NET for compatability.

Best Regards,
Phil Harvey
--------------------
http://spaces.msn.com/members/dotnetspace

Nov 21 '05 #5

P: n/a
Phil,
But only if you really need to. Correct.
DoEvents is a VB thing, and only included in
VB.NET for compatability. Totally false, DoEvents is a Windows Forms thing! Hence it being part of the
System.Windows.Forms.Application class.

It allows your program to invoke the Windows Forms Message Pump. the Message
Pump is a Win32 feature that allows your app to remain responsive to windows
messages. It converts Win32 messages into Windows Forms events.

Useful when you have an event handler that is taking too much time.
But only if you really need to. You need to be careful as DoEvents will allow your event handlers to be
reentered, for example if you call it while handling the Button1.Click
event, you could cause a second Button1.Click event to be handled at the
same time (assuming the user pressed button1 twice), this may cause
unexpected or undesired behavior in your app.

Hope this helps
Jay
"Phil Harvey" <ph***@teamlink.it> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... Application.DoEvents

But only if you really need to. DoEvents is a VB thing, and only included
in
VB.NET for compatability.

Best Regards,
Phil Harvey
--------------------
http://spaces.msn.com/members/dotnetspace

Nov 21 '05 #6

P: n/a
Thanks for that Jay, your right about the compatability and I was mistaken.
I've got this thing about it stuck in my head because I try and use threads
for anything that might hang the UI, and hence need a DoEvents call.
I just don't trust the things. Its probably just my paranoia.

Phil

--------------------
http://spaces.msn.com/members/dotnetspace
Nov 21 '05 #7

P: n/a
Phil,
Trying to use Threads is normally a good thing. However there are times when
not using them & using a Timer may be better...

It appears that VS.NET 2005 (aka Whidbey, due out later in 2005) will have a
new BackgroundWorker class that will make working with threads for easier.

For details on the System.ComponentModel.BackgroundWorker class see:
http://msdn2.microsoft.com/library/4852et58.aspx

For details on VS.NET 2005 see:
http://lab.msdn.microsoft.com/vs2005/

Hope this helps
Jay

"Phil Harvey" <ph***@teamlink.it> wrote in message
news:eX**************@TK2MSFTNGP10.phx.gbl...
Thanks for that Jay, your right about the compatability and I was
mistaken.
I've got this thing about it stuck in my head because I try and use
threads
for anything that might hang the UI, and hence need a DoEvents call.
I just don't trust the things. Its probably just my paranoia.

Phil

--------------------
http://spaces.msn.com/members/dotnetspace

Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.