473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Is there a way to temporarily disable events?

I would like to be able to change a property of a control without calling the event handler I have registered for it. For example, I would like a function like the following

void SilentSet(CheckBox* checkbox, bool set)
DisableCheckedChangedEvent(checkbox)
checkbox->Checked = set
EnableCheckedChangedEvent(checkbox)
}
Nov 17 '05 #1
2 3174
>I would like to be able to change a property of a control without calling the event handler I have registered for it.

You could tackle the problem the other way around. Set a flag, change
the property. In the handler, if the flag is set, don't do the
operation, but clear the flag.

Dave
Nov 17 '05 #2
Thats what I'm doing for now, but I think things would get a little messy if I have to create a new variable for every event I have. I would like a general way to do it that doesn't require such restructuring

I'm porting some old Unix code to .Net Windows Forms. The function I am trying to replace has an argument called notify that can be set to false to avoid the event handlers. It would be so much easier on me if I had some general purpose way of doing this instead of rewriting every single function call
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tuong Do | last post by:
Hi, I am going to insert a large amount (200,000 records) of data into a table Is there a way that I can temporarily disable the log? so that the insertion run faster Thanks in advance
2
by: Dw70 | last post by:
I need write simple program with work in background and have only one function when it is run F1 I disable and when I pres for example ctrl+k it (program is terminate) maybe somebody have...
8
by: ORC | last post by:
Hi, Is it possible to disable an event like e.g. disabling: private void textBox1_TextChanged(object....) ? Thanks, Ole
7
by: Scott Emick | last post by:
How can I disable events for the controls on a form? I tried setting the form's enable property to false, but that doesn't stop events from firing on its controls. I need to temporarily disable...
3
by: jojobar | last post by:
Hello, I am trying to localize an existing application (asp.net 2.0). using implicit as well as explicit localization. Asp.net 2.0 uses App_LocalResources folder for implicit localization....
4
by: Marc Solé | last post by:
Hello everybody, I have a little "problem". I have a DataGridView that is loaded automatically by code sometimes, and manually by the user other times. When the user introduces data in the...
4
by: Jon Slaughter | last post by:
Is there any method to temporarily disable focus changing?(I assume only method is tab or mouse?) This problem has been tieing me up for a while and nothing seems to work. The only thing that I...
10
by: Gary Jefferson | last post by:
Suppose I have 3 modules that belong to a project, 'A', 'A.a' and 'B', and each module has its own logger, created with: module1logger = logging.getLogger('project.A') and module2logger =...
37
by: Vince C. | last post by:
Hi all. I've installed Bloodshed Dev-C++ on a Windows 2000 SP4 machine. I'm using MinGW 3.4.2. I'd like to temporarily disable standard functions to write to stderr, i.e. for instance...
3
hsriat
by: hsriat | last post by:
How can I temporarily disable vertical scrollbar? I have replaced confirmation boxes and alert boxes with inlay popup DIVs. But while they are on the screen, I need to disable scrollbar of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.