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

Attaching event to a class

Hi All,

I have a class A and Class B i call Class B from Class A, i want to do something in class A when something happens in Class B, however i dont have the instance of class available with me in class B.
I tried to do the same with use of events and delegates but m not able to do it,Can someone please help me in how can i do this stuff.

Also i m using C# as my language.

Thanks in advance
Anuj Kapoor
Nov 26 '07 #1
1 1027
r035198x
13,262 8TB
Hi All,

I have a class A and Class B i call Class B from Class A, i want to do something in class A when something happens in Class B, however i dont have the instance of class available with me in class B.
I tried to do the same with use of events and delegates but m not able to do it,Can someone please help me in how can i do this stuff.

Also i m using C# as my language.

Thanks in advance
Anuj Kapoor
Things do not happen in classes, they happen in instances of classes.
What is the relationship between classes A and B?
You can pass objects to methods/constructors of other objects.
Nov 26 '07 #2

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

Similar topics

6
by: Yvan J. Gagnon | last post by:
I am currenly developing a web site using Macromedia fireworks, and am trying to figure out a way (through hand-coding) of attaching a javascript function (onClick="doit=false") to each of the...
2
by: Andrew Taranov | last post by:
Hi! I've got a problem attaching the Script Debugger to ASP pages under IIS6. Set up everything following IIS6 documentation: turned on ASP debug in IIS Manager; edited permissions for Machine...
1
by: Toby Miller | last post by:
I have this form validation that I'm trying to build, but it's not working properly. A dynamic function to the onsubmit event for a form. the result of that function (true/false) should then be...
3
by: Cowboy \(Gregory A. Beamer\) | last post by:
I have a user control that has a group of links. It is included on every page of a web application. Some of the pages are forms, and the requirements state "if any of the data has changed, you must...
6
by: WebMatrix | last post by:
Hello, Here's the situation (I'll try to be brief as possible) I am working on the control which is created dynamically based on XML string. This control consists of a table with number of rows...
5
by: | last post by:
I am wondering what the best method of attaching custom Events to custom WebUserControls are. I cannot seem to find the proper terminology to expand my research. Basicallly I have a custom user...
5
by: Mike Logan | last post by:
We are creating an HTTP Module to add code to the Application On Start of an applicaton. However, there is no HTTPApplication.OnStart event to attach to. Does anyone know how to attach to this...
6
by: Daz | last post by:
Hello everyone, I would like to open a child window from the parent, and add an onload event listener to the child window which will tell the parent when the document has loaded. As far as I...
2
by: hharry | last post by:
Hello All, In VS 2003, I was able to add event handlers in the InitializeComponent function. In VS 2005, I can no longer see the auto- generated code. I tried to add the event handler for a...
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.