473,324 Members | 2,214 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,324 software developers and data experts.

Questin on Delgates

I've read a basic tutorial on delegates but am still unclear about
them. Can someone explain what the point of using them is. I don't
completely understand them yet nor the reason for their use.
Thanks
Nov 16 '05 #1
1 1482
They're very commonly used with GUI events. i.e. When the user clicks a
button, the button automatically fires a Click event. If you want code to
respond to that Click event, you have to be able to notify the button to
call your method with that code when the Click event occurs. This is where
the delegate comes in - it provides the mechanism to tell the Click event to
call your method. So, you will define a delegate that refers to your method
and hook it up to the button's click event. Every time a user interacts
with some control in your GUI, an event will fire and any methods that have
been hooked up to that event, via a delegate, will be called.

Joe
--
Joe Mayo, Author/Instructor
Need C#/.NET training?
visit www.mayosoftware.com
C# Tutorial - www.csharp-station.com

<jw*****@gmail.com> wrote in message
news:d3**************************@posting.google.c om...
I've read a basic tutorial on delegates but am still unclear about
them. Can someone explain what the point of using them is. I don't
completely understand them yet nor the reason for their use.
Thanks

Nov 16 '05 #2

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

Similar topics

5
by: insane.andre | last post by:
ok, this may sound a little starnge, but I must ask. please forgive my....blonde moment. i know very little of PHP. Now, I want to know, is there a way I can view how php documents will look as...
4
by: FeOl | last post by:
Hi. How can I invoke the "Text1_LostFocus()" method within the "Button1_Clik()" method? Or wath parameters should I pass? Thanks in advance.
1
by: James Lennon | last post by:
I want to execute an events delegates in the windows forms thread. What is the easiest way to do this? I created another delegate and called BeginInvoke on the active form and inside this delgate...
2
by: rb531 | last post by:
Guys, I am struck up with a dilemma whether to use threading or delgates for asynchronous processing. Can anyone throw some light on this? Please let me know which one is better. Thanks
1
by: Jack Addington | last post by:
I have a 3rd party object that fires an itemchanged event when someone edits some data on a form. This event has a custom eventArgs that has a field called ActionCode. In the code of the event,...
3
by: Minh Khoa | last post by:
Please give me more information about delegate and its usage? Why do i use it and when?
0
by: Robin Tucker | last post by:
I don't want my users to be able to press buttons/manipulate objects in my software during a "critical operation" (defined as a write operation back to the database, which happens on various...
10
by: Jon | last post by:
I'm investiging multi-threaded GUI applications; specifically the technique used to ensure that controls are only modified under the correct thread. The standard technique is to use ...
0
by: craig | last post by:
Hi, I developed an app using a web-service to communcation with SQL. We wanted to implement asynchronous calls to the database, particularly when the database had retrieved the information...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.