473,396 Members | 1,754 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.

C#-APP: I am having a problem with removing event handlers

Hi, i am having a problem with removing event handlers, it is when creating nested event handlers (an event handler raising another event handler) where a part of the code is
private void toolStripButton1_Click(object sender, EventArgs e)
{
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_ MouseDown);
}
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_ MouseUp);
}
////////////////////////////////////////////////
so, when i say

this.MouseDown -= new System.Windows.Forms.MouseEventHandler(this.Form1_ MouseDown);

this.MouseUp -= new System.Windows.Forms.MouseEventHandler(this.Form1_ MouseUp);
////////////////////////////////////////////////
what happens is the event handler which is "this.MouseDown"
only is removed and the other event handler which is
"this.MouseUp" doesn't remove.
Thanks...
Apr 12 '08 #1
0 1269

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Shiju Poyilil | last post by:
I have a link button "lButton" created dynamically at the item databound event of the data grid "datagrid1" in the footer.so i want to execute the item command event of the datagrid on clicking...
5
by: Charles Law | last post by:
I think I asked the wrong question last time, so I am starting a separate post to distinguish them. Take five classes: ClassA and ClassW...Z ClassA raises five events: Event1...5 ClassW...Z...
13
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
0
by: Tom Wright | last post by:
Hi all I'm writing my first wxPython app and am having a problem with event handlers. I've set up a multi-part status bar and would like all the tooltips, menu help strings etc. to go into the...
4
by: Spectre1337 | last post by:
Hello, I'm having huge difficulties solving what should be a relatively trivial problem. The following is a gross simplification (obviously it's not that simple in reality) but it will serve its...
5
by: gnassar | last post by:
Essentially my problem is that .NET 2005 is removing my event handlers. There's no real special things about my project, it just continually removes them all. It starts on the open of a...
1
by: Armin Zingler | last post by:
Hi, I add event handlers to different events of objects of different type. In an array or arraylist, I want to store the information about which events I added. Later, I want to process the...
4
by: khalid galal | last post by:
Hi, i am having a problem with removing event handlers, it is when creating nested event handlers (an event handler raising another event handler) where a part of the code is private void...
5
by: Lloyd Sheen | last post by:
Is there a way to get the event handlers such that I can cache the info about handlers for a particular control, remove the handlers, do some code and restore the cached event handlers in VB.NET...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.