Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Is-it possible to lock events on a control?

Posted on 1998-11-30
6
162 Views
Last Modified: 2010-05-03
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.
0
Comment
Question by:dabellei
6 Comments
 
LVL 3

Expert Comment

by:traygreen
ID: 1447489
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.

0
 
LVL 1

Expert Comment

by:wizard2072098
ID: 1447490
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).
0
 
LVL 2

Author Comment

by:dabellei
ID: 1447491
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.
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.

 
LVL 12

Expert Comment

by:mark2150
ID: 1447492
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

0
 
LVL 2

Author Comment

by:dabellei
ID: 1447493
I Know this solution, what i need to know is if it is possible to disabled event.
0
 
LVL 12

Accepted Solution

by:
mark2150 earned 50 total points
ID: 1447494
No.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question