private void Form1_Load(object sender, System.EventArgs e)
{
DataSet ds = new DataSet();
ds.MergeFailed+=new MergeFailedEventHandler(ds_MergeFailed);
}
private void ds_MergeFailed(object sender, MergeFailedEventArgs e)
{
//event handler here
}
// This is in form_load for example
MyType var = new MyType();
var.MyEvent += new System.EventHandler(this.MyHandler);
// this is outside form_load, the event handler:
private void MyHandler(object sender, System.EventArgs e)
{
// handle var.MyEvent here.
}
What is the equivalent in C# to declaring an object variable WithEvents in VB.Net?
pelikan said:poor VB has legacy problems which stretch back into the mists of time when B.G. was working out of a garage. Learn a clean elegant syntax - C#.