Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
GeneralRe: Pls Help! How to reference the dynamically generate textbox ID Pin
Guffa20-Dec-06 6:24
Guffa20-Dec-06 6:24 
QuestionSocket listening Pin
choopie20-Dec-06 2:59
choopie20-Dec-06 2:59 
AnswerRe: Socket listening Pin
Eitsop20-Dec-06 4:14
Eitsop20-Dec-06 4:14 
GeneralRe: Socket listening Pin
choopie20-Dec-06 6:04
choopie20-Dec-06 6:04 
Questiongetting the checked items Pin
quiteSmart20-Dec-06 2:37
quiteSmart20-Dec-06 2:37 
AnswerRe: getting the checked items Pin
Stefan Troschuetz20-Dec-06 2:53
Stefan Troschuetz20-Dec-06 2:53 
QuestionDelegate And Event Pin
ronivars20-Dec-06 2:31
ronivars20-Dec-06 2:31 
AnswerRe: Delegate And Event Pin
Tristan Rhodes20-Dec-06 5:35
Tristan Rhodes20-Dec-06 5:35 
To start with -

A Delegate is a pointer to a function

An Event is a collection of delegates.

<br />
<br />
public void Run()<br />
{<br />
  int i = Add(a,b);<br />
  Console.Write(i);<br />
}<br />
<br />
public int Add(int a, int b)<br />
{<br />
  return a + b;<br />
}<br />
<br />


will do exactly the same as


<br />
// A delegate specifying it can hold a function that takes two integers as arguments.<br />
delegate void Adder(int a, int b);<br />
<br />
public void Run()<br />
{<br />
  // Create a new delegate containing the "Add" function defined below.<br />
  Adder a = new Adder(Add);<br />
<br />
  // Set i to the value of the result of the function contained by a.<br />
  int i = a(a,b);<br />
<br />
  Console.Write(i);<br />
}<br />
<br />
public int Add(int a, int b)<br />
{<br />
  return a + b;<br />
}<br />
<br />


For more information on events, create a windows form application and do a tutorial.

Hope that helps

Tris
GeneralRe: Delegate And Event Pin
ronivars20-Dec-06 21:41
ronivars20-Dec-06 21:41 
GeneralRe: Delegate And Event Pin
ronivars20-Dec-06 21:50
ronivars20-Dec-06 21:50 
QuestionHow to Sort HtmlElementCollection Pin
zaboboa20-Dec-06 2:27
zaboboa20-Dec-06 2:27 
AnswerRe: How to Sort HtmlElementCollection Pin
Stefan Troschuetz20-Dec-06 3:00
Stefan Troschuetz20-Dec-06 3:00 
AnswerRe: How to Sort HtmlElementCollection Pin
Ravi Bhavnani20-Dec-06 3:57
professionalRavi Bhavnani20-Dec-06 3:57 
QuestionPlaying a sound using Media.Soundplayer() Pin
QzRz20-Dec-06 2:04
QzRz20-Dec-06 2:04 
QuestionInternationalize the application Pin
AcDev720-Dec-06 2:03
AcDev720-Dec-06 2:03 
AnswerRe: Internationalize the application Pin
Netricity20-Dec-06 11:40
Netricity20-Dec-06 11:40 
QuestionFinding controls inside a region ? Pin
kkadir20-Dec-06 1:51
kkadir20-Dec-06 1:51 
Questionuploaf files using desktop applications Pin
Mridang Agarwalla20-Dec-06 1:15
Mridang Agarwalla20-Dec-06 1:15 
AnswerRe: uploaf files using desktop applications Pin
Eitsop20-Dec-06 2:37
Eitsop20-Dec-06 2:37 
GeneralRe: uploaf files using desktop applications Pin
Mridang Agarwalla20-Dec-06 9:36
Mridang Agarwalla20-Dec-06 9:36 
QuestionXmlSerialier reflection error ?? Pin
babbelfisken20-Dec-06 1:00
babbelfisken20-Dec-06 1:00 
AnswerRe: XmlSerialier reflection error ?? Pin
Eitsop20-Dec-06 2:42
Eitsop20-Dec-06 2:42 
GeneralRe: XmlSerialier reflection error ?? Pin
babbelfisken20-Dec-06 3:05
babbelfisken20-Dec-06 3:05 
GeneralRe: XmlSerialier reflection error ?? Pin
Eitsop20-Dec-06 4:09
Eitsop20-Dec-06 4:09 
GeneralRe: XmlSerialier reflection error ?? Pin
babbelfisken20-Dec-06 6:54
babbelfisken20-Dec-06 6:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.