Application.DoEvents after closing a form

S

Steven Nagy

Hey all,

I have a WinCE app and in it I have a settings form that pops up if a
menu item is pressed.
The problem is that just opening the form and closing it again, as soon
as it hits any sort of refresh command, or Application.DoEvents, it
doesn't go past that line of code.

Here's the actual code. If I put a break point in the
Application.DoEvents lines, it never gets to the NEXT line. I don't
know alot about Compact Framework so perhaps my understanding/usage of
Applciation.DoEvents is wrong. Normally I wouldn't have it at this
point anyway, but its to illustrate that it is definately the DoEvents
call that is stopping my application.

If settingsForm.ShowDialog() = DialogResult.OK Then
Application.DoEvents()
saveSettings()
init()
Else
Application.DoEvents()
End If


Many thanks,
Steven
 
D

Dick Grier

I don't know of any reason for your code to stop on this call. What version
of VS and the Compact Framework are you using? BTW, why are you calling
Application.DoEvents here? The reason isn't obvious.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004.
See www.hardandsoftware.net for details and contact information.
 
S

Steven Nagy

There is no reason for it being here.
IT was further in the code, but I put it here straight after the second
form closes to see if it also happens here, which it does.

I have a feeling it might be because of the RFID reader which is
running in another thread.
I''ve completely closed the reader before opening the second (settings)
form. And then restart it again after.
It made no difference though.
It seems completely random.

Its running on 4.2. Using VS2003.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top