Hi,
How to create my own event in c#,a button can have onclick event,onmouseover event is possible? if possible
please explain me with examples.Please explain about events and creating own events in detail.
Thanks in advance.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Apr 14, 2011, 2:56 PM
Suthish NairPosted Apr 13, 2011, 4:31 AM
example:
Button btn = new Button();
btn.Text = "Submit";
btn.Attributes.Add("onmouseover", "alert('1');");
btn.Click += new System.EventHandler(btn_Click);
this.Controls.Add(btn);
private void btn_Click(object sender, EventArgs e) { }