473,386 Members | 1,621 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,386 software developers and data experts.

tricky event question.

If I have 2 classes ("A" and "B") that inherit from the same base class, and
both override an event handler method HandleMyEvent(..), class "A" has a
hashtable of one or more class "B"'s. When the event is getting thrown,
class "A"'s overriden method HandleMyEvent(...) is catching it just fine, but
the the class "B"'s overriden method HandleMyEvent(...) doesn't seem to be
catching it. How do I get every instance of class "B" to catch the event in
it's overrided method HandleMyEvent(...)?
Nov 16 '05 #1
1 1128
Can we see code?

My guess is you forgot to add a delegate to B.HandlerMyEvent... Overriding
HandleMyEvent isn't enough. You need to subscribe *each instance*.

Alexander

"melinda" <me*****@discussions.microsoft.com> wrote in message
news:3E**********************************@microsof t.com...
If I have 2 classes ("A" and "B") that inherit from the same base class,
and
both override an event handler method HandleMyEvent(..), class "A" has a
hashtable of one or more class "B"'s. When the event is getting thrown,
class "A"'s overriden method HandleMyEvent(...) is catching it just fine,
but
the the class "B"'s overriden method HandleMyEvent(...) doesn't seem to be
catching it. How do I get every instance of class "B" to catch the event
in
it's overrided method HandleMyEvent(...)?

Nov 16 '05 #2

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

Similar topics

1
by: Tim | last post by:
Hello, I'm extremely puzzled; I cannot figure out what I'm doing wrong. Here's the situation. I would really appreciate any suggestions. I'm modifying a shopping cart in the following way....
3
by: JWA | last post by:
Hi All, How can you capture unhandled exceptions thrown by an MDI child form separate from the entire app? I have an application-wide exception handler to catch crashes by doing the following...
4
by: joebob | last post by:
The following script if run in Internet Explorer should display a thumbview of a webpage that you point it to. To test it, replace test.htm with a valid html file. The problem I'm having is that...
25
by: PyPK | last post by:
What possible tricky areas/questions could be asked in Python based Technical Interviews?
3
by: Danny | last post by:
I have a text box that is bound to a field in a database 1. How do I prevent edit of this field from data entry, but allow a user to change this by selecting from a combo box? (the combobox has...
8
by: pras.vaidya | last post by:
Hi , below given question was asked to me during an interview and i figured it out little tricky . It would be a great help if anyone could solve it. Code : - main() { char...
2
by: Tim Gallivan | last post by:
Hi group, I'm having a strange problem with event handling. My project has a form with a textbox that creates 25 instances of class A when a button is clicked. Class A raises the event without...
3
by: VB Programmer | last post by:
I have a usercontrol that sets a public/shared variable called "database_name". (User selects a dropdownlist of available databases.) A webform (webform1), that uses this usercontrol, connects to...
7
by: Matt | last post by:
Hello, In an aspx page i have webform with some textboxes and a simple button. When the button is clicked, there is a postback and then the code in the click event of the button is executed. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.