473,513 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to notifiy the creator of an object of an event

I have multiple instances of frmDevice forms that were created by a single
frmMain. I'd like alert frmMain of certain frmDevice events.
What is the best way of doing this?
Should I create an event delegate? If so, then it seems that I would need to
pass a reference to frmMain to each frmDevice, so that I can attach a frmMain
handler.
I'm somewhat new at this, so would appreciate the help,
Thanks in advance,
Dennis

Jul 22 '05 #1
2 1053
It sounds like you could use an events tutorial:

http://msdn.microsoft.com/library/de...tstutorial.asp

It seems that frmDevice should contain an event. The delegate for this event
will look something like this...

public delegate void MyDeviceEventHandler( frmDevice sender, DeviceEventArgs
e );

When frmMain creates a frmDevice, it attaches a handler to the frmDevice's
event. You only need to have the sender in the signature of the delegate if
you care where the event comes from.

Regards,

Tim Haughton

"db_from_mn" <db******@discussions.microsoft.com> wrote in message
news:B7**********************************@microsof t.com...
I have multiple instances of frmDevice forms that were created by a single
frmMain. I'd like alert frmMain of certain frmDevice events.
What is the best way of doing this?
Should I create an event delegate? If so, then it seems that I would need to pass a reference to frmMain to each frmDevice, so that I can attach a frmMain handler.
I'm somewhat new at this, so would appreciate the help,
Thanks in advance,
Dennis

Jul 22 '05 #2
Hi Tim,
Thanks for the help.
I'll give it a try.
Dennis

"Tim Haughton" wrote:
It sounds like you could use an events tutorial:

http://msdn.microsoft.com/library/de...tstutorial.asp

It seems that frmDevice should contain an event. The delegate for this event
will look something like this...

public delegate void MyDeviceEventHandler( frmDevice sender, DeviceEventArgs
e );

When frmMain creates a frmDevice, it attaches a handler to the frmDevice's
event. You only need to have the sender in the signature of the delegate if
you care where the event comes from.

Regards,

Tim Haughton

"db_from_mn" <db******@discussions.microsoft.com> wrote in message
news:B7**********************************@microsof t.com...
I have multiple instances of frmDevice forms that were created by a single
frmMain. I'd like alert frmMain of certain frmDevice events.
What is the best way of doing this?
Should I create an event delegate? If so, then it seems that I would need

to
pass a reference to frmMain to each frmDevice, so that I can attach a

frmMain
handler.
I'm somewhat new at this, so would appreciate the help,
Thanks in advance,
Dennis


Jul 22 '05 #3

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

Similar topics

1
3411
by: Stefan Ram | last post by:
Some style guides suggest to repeat a DC.creator meta-element for multiple authors, but doesn't this contradict its specification? "An entity primarily responsible for making the content of the...
1
6719
by: Gorilla | last post by:
I bound my package with EXPLAIN(YES), and it's got the following static SQL in it: EXEC SQL SELECT CARDF, RECLENGTH INTO :CARDF,:RECLENGTH FROM SYSIBM.SYSTABLES WHERE NAME = :TBNAME AND...
5
7119
by: jwmckin | last post by:
Is there a way to have Access look inside a folder or folders and with a query create a list of files within these folders? Thanks in advance
2
1491
by: Max-Ph. Blickenstorfer | last post by:
I am currently in a black hole looking for a way accessing the creator object of a class within the class. Something like parent of winform controls. Thanks for you time Max
2
234
by: db_from_mn | last post by:
I have multiple instances of frmDevice forms that were created by a single frmMain. I'd like alert frmMain of certain frmDevice events. What is the best way of doing this? Should I create an event...
0
1453
by: Roshan | last post by:
Hi, I am trying to programatically add a FileSystemAccessRule for CREATOR OWNER to the filesystemsecurity obj of a folder whose creator and owner is a user account say 'SomeUser'. The rule gets...
1
2174
by: shiju | last post by:
Hi all, whenever dbo is prifixed with the create script the owner becomes dbo. If the below script run by the sam the owner becomes dbo create proc dbo.test as print 'hello'
0
7939
by: FlightController | last post by:
Hello Everyone, Not only am I new to the forum I am entirely new to programming in VBA. I am having a problem getting some sample code working. To give you background on what I want it to do: I...
13
2401
by: alive84 | last post by:
Hi there, I have a two problems concerning option button values on a report and data report creator reports. The situation: I have three option value boxes two have 3 option and one has...
0
7257
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
7379
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
7521
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...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.