protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (_readOnly) { return(true); } if (msg.Msg == 256) { int key = msg.WParam.ToInt32(); if (key == 37) //left { mathExp.SelectPrevious(); this.Refresh(); return(true); } else if (key == 39) //right { mathExp.SelectNext(); this.Refresh(); return(true); } else if (key == 0x2d) //insert { mathExp.AddEmptyNode(); this.Refresh(); _changed = true; return(true); } else if (key == 0x2e) //delete { mathExp.DeleteSelectedNode(); RefreshVariableMap(); this.Refresh(); _changed = true; return(true); } else if (key == 8) //backspace { mathExp.Backspace(); RefreshVariableMap(); this.Refresh(); _changed = true; return(true); } else if (key == 38) //up { mathExp.OnKeyUp(); _changed = true; this.Refresh(); return(true); } else if (key == 40) //down { mathExp.OnKeyDown(); _changed = true; this.Refresh(); return(true); } } else if (msg.Msg == 255) { return(true); } return(base.ProcessCmdKey(ref msg, keyData)); }