Delegate + Event in C#
-
Hi all I'm faced to deverlop a program that sends a message from one form to another using Delegate and Event. I do know a little about Delegate but do not know about Event. I can't make them work together. Here is my exaple
Nine_ wrote:
Here is my exaple
Er.............. Where? Or are you using anonymous delegates?
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Hi all I'm faced to deverlop a program that sends a message from one form to another using Delegate and Event. I do know a little about Delegate but do not know about Event. I can't make them work together. Here is my exaple
//aspx.cs page //button1 click will fire the delegate event and then the onShowAllClick will fire the event. protected void Button1_Click(object sender, EventArgs e) { Response.Write("hi"); } //delegate event public void ShowAllClick(object sender, System.Web.UI.WebControls.CommandEventArgs e) { Response.Write("hello"); } //delegate public event CommandEventHandler Show; protected void onShowAllClick(Object sender, CommandEventArgs e) { if (e is CommandEventArgs) { ShowAllClick(sender, e); } } //aspx page
Padmanabhan