.NET Framework 1.xFor discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the .NET Framework 1.x section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
I have a class MyDataGrid which is inherited from Datagrid
which have two protected override functions.
i want to register the events.
for example
public class MyDataGrid : DataGrid
{
protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
{
//dosomething
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
//dosomething
}
Now i want to register these events
i m registering as
this.dataGrid1.MouseDown+=new System.Windows.Forms.MouseEventHandler(this.OnMous eDown);
this.dataGrid1.MouseMove+=new System.Windows.Forms.MouseEventHandler(this.OnMous eMove);
error is
Method 'System.Windows.Forms.Control.OnMouseDown(System.W indows.Forms.MouseEventArgs)' does not match delegate 'void System.Windows.Forms.MouseEventHandler(object, System.Windows.Forms.MouseEventArgs)'
Method 'System.Windows.Forms.Control.OnMouseMove(System.W indows.Forms.MouseEventArgs)' does not match delegate 'void System.Windows.Forms.MouseEventHandler(object, System.Windows.Forms.MouseEventArgs)'
can anybody tell me waht's the solution?
i m coding in C# Windows application ,version 1.1(2003)
======================================
"They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad."
--Shakespeare
======================================