Question Stop an application looking like it has crashed?

Cobalt

Member
Joined
May 28, 2008
Messages
21
Programming Experience
3-5
Hello all,

I have a vb app that accesses a network drive and deletes some folders if certain things are true. At the moment if one of the folders is very large or there is a network delay the app seems to freeze and looks like it has crashed.

I already have a "progress form" popup which has a multi line text box which gets populated with event info. This form is made visable before the network work begins but again seems to crash, only updating/being select and scroll-able when all the network tasks are complete.

Is there a nice way for me app to be selectable while it is working, or at least not white out completely when it hits a delay?

Also, could some one post the function/code I should research to disable a folder share on a network location?

Many thanks in advance for any help that can be given.
 
It is called "multi-threading", read some about it. An easy route is to use the BackgroundWorker component found in the Toolbox.
 
Thanks for the point in the right direction John, I didn't know my terminology!

For anyone who stubles accross this thread I would highly recommend this tutorial as a great one to start. Nice and slow, but clearly showing how it works allowing the user to take the lessons learnt and use then in loads of different situations.

Anyway, I have'nt finished it all yet, but the first few pages got me programatically further than a million other google hits and MS help pages!

Linky - http://www.devcity.net/Articles/352/1/article.aspx
 
Similar Question

Let's say I wanted to run code which takes roughly 45 seconds. During this 45 seconds I want a list of progress ouputs dumped into a list box on the current form, not on a different form as in the example from the previous link. And of course do this without giving me a blank list box until the end.

Any suggestions?

Thanks
 
Let's say I wanted to run code which takes roughly 45 seconds. During this 45 seconds I want a list of progress ouputs dumped into a list box on the current form, not on a different form as in the example from the previous link. And of course do this without giving me a blank list box until the end.

Any suggestions?

Thanks
Your case is no different, learn multithreading, start with learning BackGroundWorker component.
 
I agree, in the end I moved away from the new progress window and used a listbox built into the main form itself.

The background worker was very easy to work with once I understood the concept (especially getting around the fact that the Worker cannot nativly access elements on the main form).

I will post some examples when I'm back in work if it would help?

The tutorial linked above should really be checked out, should cover off your question quite well.

Cheers
 
Back
Top