How to cancel a mmouseup event

tfurnivall

Registered User.
Local time
Today, 02:07
Joined
Apr 19, 2012
Messages
81
I have a need to 'prevent' an event from completing under certain circumstances, and it is not clear how I can accomplish this.
I have an app that is browsing a survey. When the survey is in simple 'browse' mode, I want to be able to emulate the effect of a SkipResponse. (A SkipResponse is when selecting a particular value causes the normally sequential processing of survey questions to become non-linear. A sort of If Response = thisvalue then next question is something else)
I can 'request' the SkipResponse by using Ctrl/Alt click, and then emulate returning from the target question by using Ctrl/Shift Click. My problem is that I want to do the same thing (for a return) by allowing Ctrl/Shift on the Exit button. If I just use a regular mouseup evvent, it will complete, but will then go ahead and run the code for the Click event, to exit the survey. What I would like is to be able to cancel the processing of the Click event from within the handler of the MouseUp event.

(Is this clear - it's very cumbersome to write it out like this!)
There's no cancel parameter on the mouseup events, and I wondered if anybody had encountered and (preferably) solved this little problem.

Thanks,

Tony
 
You could try creating a public boolean value (called say MseUp) in your form module, set it to false in the form open event and true in the mouse up event.

Then in your sub which you want to stop, use

Code:
If Not MseUp then
    ....do your code here
end if
 
Thanks CJ

I'd thought of that, but since there are quite a few controls where this 'extra' functionality would be useful, maintaining all of those extra flags would become somewhat of a nghtmare (Not right away, you understand, but in 6 months when I have to look at all of them and remember exactly how they work ;-)

What'm I'm going to do (at least for now) is to use only controls that have no other function (like labels), so that the already rare Ctrl/Alt click can't possibly get confused with anything else. It's not that intuitive, but it's less of a problem!

Thanks, again

Tony
 

Users who are viewing this thread

Back
Top Bottom