doevents

How do I delay a vb.net program until a file operation completes?

I have this: Dim myTemp As String myTemp = System.DateTime.Now().ToString("MMMddyyyy_HHmmss") & ".pdf" System.IO.File.Copy(myFile, "c:\" & myTemp) Application.DoEvents() OpenFile(myTemp) The problem is that when I call OpenFile, which is just a call to a sub that opens a file, it cannot find the file. This is bec...

Can you catch exception from inside Application.DoEvents()?

I've encountered a strange difference between a program running in VS2005 and running the executable directly. Essentially, when an exception is thrown in a method inside an Application.DoEvents() call, the exception can be caught when running inside Visual Studio. When running the compiled executable, the exception is not caught and t...

Application.DoEvents, when it's necessary and when it's not?

Hi what is the necessity of using Application.DoEvents and when we should use it? ...

Windows Forms Click event repeating itself

I have a strange problem with a Windows Forms event. To be exact, it's a KryptonHeaderGroup's ButtonSpec Click event, but it also happens with a plain vanilla System.Windows.Forms.Button. In the click event, the user interface is brought down (there's a label and a cancel button left), and then an expensive LINQ query is built from prev...

Custom Modal Window in WPF?

I have a WPF application where I'd like to create a custom pop-up that has modal behavior. I've been able to hack up a solution using an equivalent to 'DoEvents', but is there a better way to do this? Here is what I have currently: private void ShowModalHost(FrameworkElement element) { //Create new modal host v...

.net 2010 calling DoEvents (yes I want to) from inside a custom control library

I have a custom control's library. Now there's a control which looks like a panel, and when it opens up I want to animate its vertical growing like this: For h As Single = 0 To finalHeight Step 0.5 Me.Height = CInt(h) ' HERE I WANT TO CALL DoEvents' Next Me.Height = finalHeight If I don't call DoEvents in the loop then the a...

VB6 program crashing during DoEvents, why?

I have a printing application that is using the Printer object to print files. On one particular machine (not others), this program will crash after processing some number of files (20 or so). The crashes always occur during a DoEvents call. Has anyone seen anything like this? Thanks! ...

Is Application.DoEvents() my only choice (in this case)?

I have some commercial equipment that I can connect to with a .Net library supplied by the equipment manufacturer - so I have no control over the library or the equipment, only my code. The manufacturer has set their system up so that if you are not connected to the equipment via their library then it works fine. However, when you do c...

WPF Dispatcher.PushFrame vs WinForms Application.DoEvents?

In WinForms, Application.DoEvents method has been regarded as evil by some people. Can anybody tell if its counterpart of Dispatcher.PushFrame in WPF is safe to use? ...

C# BackgroundWorker - how should i get rid of DoEvents

I'm trying to figure out the best way to handle a backgroundworker that is triggered off radio button clicks. I created a very simple form with 3 radio buttons and a label. Each of the radio buttons share the same event radioButton_CheckedChanged. If the event completes then I update the label to "Complete". If you click another radio...