Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pause for user input 3

Status
Not open for further replies.

drewson

MIS
Jun 3, 2003
50
US
What's the best way to pause a process for user input?

Here's my situation:
I open a form with a progress bar that shows images processed. If it gets to an error, the sub needs to stop, activate controls on the form for user input, then continue when the user clicks Continue.

I thought that I would just put the sub into an loop with DoEvents() in it, checking against a boolean for when the user clicks Continue. Is this efficient, or is there a better way?

Thanks!
Drew
 
You can pause/wait on a MessageBox. The user can simply click it when ready to proceed.
 
That's one way, but I need to have my users enter into a textbox before the sub can continue.
 
You can create your own "MessageBox", and accept whatever text there.
 
I guess I should have added this caveat: I'm doing double key entry for data entry and have to not only bring up a box to type it in, I have to display an image as well. Opening up a new form would force me to pass the image between forms, etc. Is this still the best way?

Thanks again!
 
Yep.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
>Is this still the best way?

It's difficult to tell without knowing the details of the application. But, you have several options:

1. Your "MessageBox" and add a picture (if that's all it would take).

2. If this is a transaction processing application, you may have to abort the last transaction, and restart it when the user response is good. This may mean redisplaying the original form and input works.

3. Go through all transactions, and edit them first. Once all the wrinkles have been ironed out, you can proceed with processing for keeps.

I would prefer option 3, unless the application demands something else.
 
I think I'm going to go with option 1 for now. It'll save me some headache.

Thanks!
 
Well, let me explain more of what I'm doing...

My program loops through images and reads barcodes off of any image with a barcode. Those barcodes are read into an arraylist. If a barcode is read incorrectly, it gives the user the ability to key in the barcode number from the image. Thus, I need to stop the loop, allow the key entry, put the key entry into the arraylist, and then start the loop up on the next item in the arraylist. Does this give any more ideas?

Thanks!
 
Psuedo-style:

Loop
Read Barcode
Verify Barcode
if barcode fails validation then
open manual entry dialog form, pass in image of barcode, return entered text.
if returned text is valid, set the barcode to validated
end if

if Barcode is validated add to array list
update status bar
end loop

You may find this FAQ: faq796-5671 helpful for making a dialog form.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
All right, that's what I thought I'd have to do... thanks for all the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top