473,587 Members | 2,451 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 1059
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 MyDeviceEventHa ndler( 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******@discu ssions.microsof t.com> wrote in message
news:B7******** *************** ***********@mic rosoft.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 MyDeviceEventHa ndler( 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******@discu ssions.microsof t.com> wrote in message
news:B7******** *************** ***********@mic rosoft.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
3419
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 resource." http://dublincore.org/documents/dcmi-terms/ "primarily (...) in the first place" http://www.m-w.com
1
6730
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 CREATOR = :TBCREATOR The explain shows that it does a *full table scan* on SYSIBM.SYSTABLES!
5
7122
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
1499
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 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...
0
1464
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 created and added without errors. After I have set the security descriptor I notice that 2 ACEs have been added. One for CREATOR OWNER with the...
1
2180
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
7946
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 need the script to print an active worksheet to PDF Creator and assign the WorkSHEET name as the filename. So far I can get the for to be called...
13
2414
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 only two option buttons. They have values 1, 2, 3. Everything is standard. Now when I create the report, I have only the number for each record on the...
0
8215
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8347
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7973
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5718
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3844
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
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 we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.