Pause Program Until User Input

Ian W

Active member
Joined
Feb 11, 2010
Messages
31
Programming Experience
1-3
I'm tryng to figure out a way how I can stop my code from running while I wait for input from a device.

Scenerio..

Networked device that sends data to .net app.

I now wish to prompt the user to answer a 'Continue' questoion and select either 'Yes' or 'No' on the device. This is transmitted to program over netstream.

I want the code to pause though while waiting for an answer as different routines are run dependent on the answer.

Sorry if its a silly question !
 
A msgbox won't work in this instance as the user never sees a VB interface.

VB controls a networked device that the user interacts with.
 
You don't actually want this:
I'm tryng to figure out a way how I can stop my code from running while I wait for input from a device.
If your code stops running then you can't receive the input from the device. What you want is to prevent the user from interacting with your form until you receive input from the device. For that I'd say that you have two choices:

1. Set your form's Enabled property to False and then set it back to True when you receive the input from the device.

2. Pop up a modal dialogue that the user can't close and have it receive the input from the device and then close itself.
 
Had a think about this and instead of pausing the program I just rejigged it so the code actually when user input is required. The netstream is then set to only accept user input and then once input is detected it continues.
 
Back
Top