inputbox timeout

I saw a thread on timming-out forms, my question is can input box be timmed-out?  It seems to put the rest of the program into a wait state untill it is answered.  If so, how (example please.)  
tm009Asked:
Who is Participating?
 
cookreConnect With a Mentor Commented:
The best way to do that is with a timer - that way everything runs normally and any window events in your program get handled.  You didn't mention a language, so the general approach is:

In main body:
Start Timer
Put focus in target field

In routine to capture field entry complete (lost focus on target field, validation triggered, enter pressed, etc):
Disable timer
Do what youo want when user entry is completed before timeout
In timer interrupt handler:
Disable timer
Do what you want to do when timeout trips

0
 
PhoenixricCommented:
Hi tm009,

Inputboxes behaves like message boxes and one of their behavior is to freezed the entire program until it is answered. Explanation of this is that when the code handle passes through an input or message box, theres no way to get out on that handle unless you pressed ok or cancel.

If you wish to use inputs that pop-ups like input boxes and need to timmed it out, you can use another form instead of inputboxes to behave as you want it too.

hope this one helps.
0
 
PhoenixricCommented:
Hi,
Just curious how input box can be timeout by a timer? The author's question is how can the program continue with the other events, when an input box is loaded? or how can the input box be timeout, as the authors concern: ( It seems to put the rest of the program into a wait state untill it is answered) cookre answer is quite far cause he might misinterpreted the question by on how to use a timer. .  I hope I made my self clear. . . Please review the question again. . .

Thanks.

PhoenixRic ;-)
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
cookreCommented:
The purpose of the timer is to take back control after a certain amount of time has expired.  When the timer fires, the program can do as it pleases with the content of the input field and can switch focus as appropriate.

Placing focus in an input field doesn't block anything per se. The program can continue doing as it pleases, as long as it realizes that events can fire at any time (which is why many programmers just let the program idle until some event fires).
0
 
PhoenixricCommented:
Sir cookre,
Yes Sir I understand and thats a good timer control capability, but its not an ordinary input field (as I understood,pls correct me if I'm wrong), its an input box field. . and when trigerred, as the author concerned "( It seems to put the rest of the program into a wait state untill it is answered) " Im very much interested on the idea of on how an input box can be timed out when it is loaded, or specifically, how can a timer control this scenario. Because base on my experiences on this, even if a timer is enabled, its execution will be put into a wait state also when an input box is triggered/loaded. From this time, other events will not be available cause the program execution is paused waiting for a user input and will be operational again, the time user pressed ok or cancel and there's no way to go out on that block of code ( MyInput = Inputbox("Pls enter a value") or waiting state. With this inputbox limitation, I chose to use other means of input interface such as another form or pop-ups style picture boxes.

I may not understood your full idea Sir, and I just want to discuss this cause Im very interested on how to... Cause this one scenario really makes me think a lot. . . And I hope you can educate me with this Sir. Thanks.

PhoenixRic ;-)


P.S. Im not after on any credits, points or the likes. .  Just for the new learning that I can Achieved here. Thanks
0
 
cookreCommented:
You finally got through to me - I was reading 'input box' instead of 'InputBox'.  

It can still be done by using SendMessage() in the timer routine.  I'll see if I can dig up some code.
0
 
tm009Author Commented:
I was actually able to time out the inputbox.  But, that caused another problem.  The Input box will not automatically close.  It now stays open until the time out is reached.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.