npaun
asked on
How to temporary block mouse and keyboard input to my application?
How to temporary prevent users’ mouse and keyboard input to my application window, for instance, when the application is processing some data? I don’t want to use API BlockInput, as it completely blocks input to ALL applications, which is not good. I only need to block input to MY application, for instance in the manner: user hovers mouse over my app window, the cursor changes to Hourglass, and the mouse/keyboard input to my app window is disabled, until the processing is done, and input again explicitly enabled. Ideally, I should be able to specify handle to the window of my app I wish to block, or perhaps event to have option to block input to all windows belonging to my applications.
ASKER
well, that was an obvious approach... problem is, I have A LOT of controls on my form, and I would like not to have to disable/enable each and every of them... I'm looking for a more elegant solution, if there is a such...
well i guess im out!
you can use a for each to cycles through the controls and set the enable props without having to implicitly name them all..
for each ctrl in form.controls
ctrl.enabled=false
next ctrl
for each ctrl in form.controls
ctrl.enabled=false
next ctrl
ASKER
yes, I'm familiar with that approach too...
guess you dont need me then ... still a thanks wouldnt have hurt!
ASKER
thanks for the post
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
it works, just perfect...
Well, this is a little embarrassing, I've never before had this need, and I simply overlooked the simplest possible approach... I never actually noticed before that the Form too has the Enabled property, nor used it... I simply jumped ahead I assumed there probably must be some convoluted approach... LOL
Thanks. Problem solved.
Well, this is a little embarrassing, I've never before had this need, and I simply overlooked the simplest possible approach... I never actually noticed before that the Form too has the Enabled property, nor used it... I simply jumped ahead I assumed there probably must be some convoluted approach... LOL
Thanks. Problem solved.
Haha, sometimes the solutions are very easy! I use it in Access sometimes to make sure users cannot make changes while stuff is being processed behind the scenes. VB6 and VBA aren't that far apart. Glad you got it going though!
i.e.
MyCommandButton.enabled=fa
MyTextBox.enabled=false
then for the duration of the processing use screen.mousepoint=11 to show busy..
example of mouse pointer :-
http://support.microsoft.com/kb/71105