protected override void WndProc(ref Message m)
{
// System.Diagnostics.Debug.WriteLine(m.Msg);
switch (m.Msg) {
case 2: // WM_DESTROY
if (!this.HandleDestroy(ref m))
base.WndProc(ref m);
break;
//case 0x14: // WM_ERASEBKGND
// Can't do anything here since, when the control is double buffered, anything
// done here is immediately over-drawn
// break;
case 0x0F: // WM_PAINT
if (!this.HandlePaint(ref m))
base.WndProc(ref m);
break;
case 0x46: // WM_WINDOWPOSCHANGING
if (this.PossibleFinishCellEditing() && !this.HandleWindowPosChanging(ref m))
base.WndProc(ref m);
break;
case 0x4E: // WM_NOTIFY
if (!this.HandleNotify(ref m))
base.WndProc(ref m);
break;
case 0x0100: // WM_KEY_DOWN
if (!this.HandleKeyDown(ref m))
base.WndProc(ref m);
break;
case 0x0102: // WM_CHAR
if (!this.HandleChar(ref m))
base.WndProc(ref m);
break;
case 0x0200: // WM_MOUSEMOVE
if (!this.HandleMouseMove(ref m))
base.WndProc(ref m);
break;
case 0x0201: // WM_LBUTTONDOWN
if (this.PossibleFinishCellEditing() && !this.HandleLButtonDown(ref m))
base.WndProc(ref m);
break;
case 0x202: // WM_LBUTTONUP
if (this.PossibleFinishCellEditing() && !this.HandleLButtonUp(ref m))
base.WndProc(ref m);
break;
case 0x0203: // WM_LBUTTONDBLCLK
if (this.PossibleFinishCellEditing() && !this.HandleLButtonDoubleClick(ref m))
base.WndProc(ref m);
break;
case 0x0204: // WM_RBUTTONDOWN
if (this.PossibleFinishCellEditing() && !this.HandleRButtonDown(ref m))
base.WndProc(ref m);
break;
case 0x0206: // WM_RBUTTONDBLCLK
if (this.PossibleFinishCellEditing() && !this.HandleRButtonDoubleClick(ref m))
base.WndProc(ref m);
break;
case 0x204E: // WM_REFLECT_NOTIFY
if (!this.HandleReflectNotify(ref m))
base.WndProc(ref m);
break;
case 0x114: // WM_HSCROLL:
case 0x115: // WM_VSCROLL:
//System.Diagnostics.Debug.WriteLine("WM_VSCROLL");
if (this.PossibleFinishCellEditing())
base.WndProc(ref m);
break;
case 0x20A: // WM_MOUSEWHEEL:
case 0x20E: // WM_MOUSEHWHEEL:
if (this.PossibleFinishCellEditing())
base.WndProc(ref m);
break;
case 0x7B: // WM_CONTEXTMENU
if (!this.HandleContextMenu(ref m))
base.WndProc(ref m);
break;
default:
base.WndProc(ref m);
break;
}
}