shenhongmin2
路人甲
路人甲
  • 注册日期2005-08-12
  • 发帖数2
  • QQ
  • 铜币112枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1105回复:2

MapControl 的 自定义工具如何设为空啊(C#)?

楼主#
更多 发布于:2005-08-23 08:59
<P>ICommand command = new ControlsMapZoomOutToolClass ();<BR>    command.OnCreate(axMapControlMain.Object);<BR>    if(command.Enabled == true)<BR>    {<BR>     axMapControlMain.CurrentTool = (ITool) command;</P>
<P>    }</P>
<P>设为空axMapControlMain=(ITool)null,这样不行,要抱错啊!</P>
<P>高手指点.</P>
喜欢0 评分0
kisssy
卧底
卧底
  • 注册日期2004-04-18
  • 发帖数235
  • QQ
  • 铜币614枚
  • 威望2点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2005-09-01 18:12
<P>我在VB里是建一个类模块叫DoNothingTool,继承Icommand和Itool,然后什么也不干。</P>
<P>    Dim pCom As ICommand<BR>        Set pCom = New DoNothingTool<BR>        pCom.OnCreate (mapCtrl.object)<BR>        pCom.OnClick<BR>        If TypeOf pCom Is esriSystemUI.ITool Then<BR>            Set mapCtrl.CurrentTool = pCom<BR>        End If</P>
个人专栏: https://zhuanlan.zhihu.com/c_165676639
举报 回复(0) 喜欢(0)     评分
xxwwdd
路人甲
路人甲
  • 注册日期2003-08-19
  • 发帖数88
  • QQ
  • 铜币230枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2005-08-28 22:30
((axMapControlMain.Object) as IMapcontrol).CurrentTool = (ITool) command
举报 回复(0) 喜欢(0)     评分
游客

返回顶部