Link to home
Start Free TrialLog in
Avatar of dabellei
dabellei

asked on

Is-it possible to lock events on a control?

I need to disabled an event on a control to do some operation is-it possible to do so?

Ex.: i want to disable the click event on a grid but not the double-click.
Avatar of traygreen
traygreen

Give an example of what you're trying to do.  If you're trying to eliminate circular references, you can set a local static or form level variable and check it on entering the event.

Can you be more specific? Click and Double-Click are two different windows messages, and are independent of each other. Are you actually trying to eat the message itself, so the control never even gets the message? If so, you'll have to write a hook to trap the message coming in on the queue and eat it (not too hard, but I'll reserve the example until you say that's what you need).
Avatar of dabellei

ASKER

Ok guy.

Let see in each control we have some event (click, double-click, change...)  in the programm we're making we need to desabled one event (like change event) on one control.  Sometime we need the validation that's in the event change sometime we need to bypass it (printing a report with the data on the screen and skip the validation).  Taht's why i need to disabled one event on a control at some time.
Have the event handler check a global boolean that is set when you want things not to happen. Encase all the code in the event in a:

IF {statevar} THEN


ENDIF

M

I Know this solution, what i need to know is if it is possible to disabled event.
ASKER CERTIFIED SOLUTION
Avatar of mark2150
mark2150

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial