Hello!
I have a weird problem.
I have a program that freezes up when the PC is locked (CTRL ALT DEL).
When it is in the VB .NET environment, it does not do this, only when running the exe by itself.
Anyone ever seen this before?
Printable View
Hello!
I have a weird problem.
I have a program that freezes up when the PC is locked (CTRL ALT DEL).
When it is in the VB .NET environment, it does not do this, only when running the exe by itself.
Anyone ever seen this before?
OK, i have narrowed it down to this code causing it:
Me.TopMost = true
then some code
Me.TopMost = False
Any idea why that would cause it to freeze up on the CTRL ALT DELETE?
The reaon i was using it is to push the form to the top when it was done processing something. in case the user was working on something else.
I doubt a program would be able to become TopMost when the PC is locked...? That would probably be your problem.
But the code put it into topmost = true, then to topmost = false.
After the process is done running, I hit CTRL ALT DEL.
Its tricky.
Narrowed it down even more. The TopMost that was causing it was in a procedure thata was called in a background workers dowork sub.
Still not sure why it wasn't causing an error, but found it. Whew!
You are not supposed to access control members from any thread other than the one on which they were created. Sometimes it can work but many times you get unexpected results and this is a case in point. You need to either:Quote:
Originally Posted by jeffcravener
1. set the TopMost property of the form only before calling RunWorkerAsync, in the ProgressChanged event handler or in the RunWorkerCompleted event handler; or
2. use delegation to marshal a call to the UI thread.
The links in the Multithreading section of my signature may be helpful to you.