Solved

Is-it possible to lock events on a control?

Posted on 1998-11-30
6
159 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 12

Expert Comment

by:mark2150
Comment Utility
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
Comment Utility
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
Comment Utility
No.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now