c#继承Mapx的问题
在C#中我继承了 AxMapXLib.AxMap,添加了几个简单的方法后,原来能使用的好好的选择功能(直接调用 axMap.CurrentTool=MapXLib.ToolConstants.miRadiusSelectTool之类)忽然不能选择了,请问为什么?
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace MapEditor
{
class MapXEx : AxMapXLib.AxMap
{
private double m_ZoomScale = 2.0;
private float m_MoveScale = 100.0F;
public double ZoomScale
{
get { return m_ZoomScale; }
set { m_ZoomScale = value; }
}
public float MoveScale
{
get { return m_MoveScale; }
set { m_MoveScale = value; }
}
public MapXEx()
{
this.KeyUpEvent += new AxMapXLib.CMapXEvents_KeyUpEventHandler(onKeyUp);
}
public override bool PreProcessMessage(ref Message msg)
{
if ((Keys)msg.WParam ==Keys.Delete) return true;//屏蔽delete键
return base.PreProcessMessage(ref msg);
}
public void onKeyUp(object sender, AxMapXLib.CMapXEvents_KeyUpEvent e)
{
switch ((Keys)e.keyCode)
{
case Keys.Add://zoom in,'+'
case Keys.Oemplus:
this.Zoom /= m_ZoomScale;
break;
case Keys.Subtract://zoom out,'-'
case Keys.OemMinus:
this.Zoom *= m_ZoomScale;
break;
case Keys.Left:
this.Pan(-m_MoveScale, 0);
break;
case Keys.Up:
this.Pan(0, m_MoveScale);
break;
case Keys.Right:
this.Pan(m_MoveScale, 0);
break;
case Keys.Down:
this.Pan(0, -m_MoveScale);
break;
default:
//MessageBox.Show(e.keyCode.ToString());
break;
}
}
}
}