Click to See Complete Forum and Search --> : How Do You Have Multiple Things Running At Once?


S-10 Man
August 22nd, 2001, 04:01 AM
I have a picture box that has multiple picture boxes in it. I have it set up so when you click on a certain picture box it will move it to another point that you click on. The only problem is that you have to wait until it reaches that point until you can click and move another(Or you stop the first). How do you make it so you can have two things(or more)going on at once? Thank you very much.

Cakkie
August 22nd, 2001, 05:42 AM
This should be done with multithreading, the problem is however, that VB doesn't support multithreading. There are some codes around that can achieve that, but it's quite complicated, and doesn't always work.

In your case, you might try using DoEvents, this gives control back to the system, allowing screen updates, and receiving of events, like clicks. When you are moving the picture, you are probably looping, which freezes the app until the loop finishes. When you place doevents in the loop, it will return control to the system, not making your app freeze.

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook