Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Windows Form Freezes launching from script

$
0
0
Hi Praveen,

The problem is likely that you're showing the form on a worker thread instead of your application's UI thread. Try this:
FileSystemWatcher _fileWatcher = new System.IO.FileSystemWatcher();
vde.AddHostObject("_fileWatcher", _fileWatcher);
// ...
_fileWatcher.SynchronizingObject = someForm; // <-- ADD THIS LINE
where someForm is your application's main form or some other form that's active before you run your script.

Good luck!

Viewing all articles
Browse latest Browse all 2297

Trending Articles