asdp
路人甲
路人甲
  • 注册日期2004-10-20
  • 发帖数11
  • QQ
  • 铜币151枚
  • 威望0点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
阅读:1647回复:4

[求助]关于statusbar的问题

楼主#
更多 发布于:2005-09-07 14:55
<P>我在help中找到statusbar的例子,其中OnCurrentViewChanged如下</P>
<P><FONT color=#0000ff>private void</FONT> axArcReaderControl1_OnCurrentViewChanged(<CODE><FONT color=#0000ff>object</FONT></CODE> sender, ESRI.ArcGIS.ArcReaderControl.IARControlEvents_OnCurrentViewChangedEvent e)<BR>    {<BR>      <CODE><FONT color=#008000>//Set current tool</FONT></CODE><BR>      <CODE><FONT color=#0000ff>if</FONT></CODE> (axArcReaderControl1.CurrentViewType == esriARViewType.esriARViewTypeMap)<BR>      {<BR>        <CODE><FONT color=#0000ff>if</FONT></CODE> (axArcReaderControl1.CurrentARTool != esriARTool.esriARToolMapPan)<BR>        {<BR>          axArcReaderControl1.CurrentARTool = esriARTool.esriARToolMapPan;<BR>        }<BR>      }<BR>      <CODE><FONT color=#0000ff>else if</FONT></CODE> (axArcReaderControl1.CurrentViewType == esriARViewType.esriARViewTypePageLayout)<BR>      {<BR>        <CODE><FONT color=#0000ff>if</FONT></CODE> (axArcReaderControl1.CurrentARTool != esriARTool.esriARToolLayoutPan )<BR>        {<BR>          axArcReaderControl1.CurrentARTool = esriARTool.esriARToolLayoutPan;<BR>        }<BR>      }<BR><BR>      <CODE><FONT color=#008000>//Get IARCommandInfo interface</FONT></CODE><BR>      IARCommandInfo arCommandInfo = axArcReaderControl1.get_ARCommandInfo(axArcReaderControl1.CurrentARTool);<BR>      <CODE><FONT color=#008000>//Display the message property of the current tool in the status bar</FONT></CODE><BR>      StatusBar1.Panels[0].Text = arCommandInfo.Message;<BR>    }<BR>我写的是这样</P>
<P>private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)<BR>  {<BR>   //Get the first layer in the focus map<BR>   IARLayer arLayer = axReaderControl1.ARPageLayout.FocusARMap.get_ARLayer(0);<BR>   //Open the find window set to perform a find on the layer<BR>   axReaderControl1.ShowARWindow(esriARWindows.esriARWindowsFind, true, arLayer);</P>
<P>   <BR>  }</P>
<P>  private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)<BR>  {<BR>   IToolbarBuddy toolbarBuddy = (IToolbarBuddy) axReaderControl1.Object;<BR>   ICommand command = new ControlsReaderIdentifyToolClass();<BR>   command.OnCreate(toolbarBuddy);<BR>   axReaderControl1.CurrentARTool = esriARTool.esriARToolCustom;<BR>   toolbarBuddy.CurrentTool = (ITool) command;<BR>  <BR>  }</P>

<P><FONT color=#0000ff>private void</FONT> axArcReaderControl1_OnCurrentViewChanged(<CODE><FONT color=#0000ff>object</FONT></CODE> sender, ESRI.ArcGIS.ArcReaderControl.IARControlEvents_OnCurrentViewChangedEvent e)<BR>    {<BR>      <CODE><FONT color=#008000>//Set current tool</FONT></CODE><BR>      <CODE><FONT color=#0000ff>if</FONT></CODE> (axArcReaderControl1.CurrentViewType == esriARViewType.esriARViewTypeMap)<BR>      {<BR>        <CODE><FONT color=#0000ff>if</FONT></CODE> (axArcReaderControl1.CurrentARTool != esriARTool.esriARToolCustom)<BR>        {<BR>          axArcReaderControl1.CurrentARTool = esriARTool.esriARToolCustom;<BR>        }<BR>      }<BR>      <CODE><FONT color=#0000ff>else if</FONT></CODE> (axArcReaderControl1.CurrentViewType == esriARViewType.esriARViewTypePageLayout)<BR>      {<BR>        <CODE><FONT color=#0000ff>if</FONT></CODE> (axArcReaderControl1.CurrentARTool != esriARTool.esriARToolCustom )<BR>        {<BR>          axArcReaderControl1.CurrentARTool = esriARTool.esriARToolCustom;<BR>        }<BR>      }<BR><BR>      <CODE><FONT color=#008000>//Get IARCommandInfo interface</FONT></CODE><BR>      IARCommandInfo arCommandInfo = axArcReaderControl1.get_ARCommandInfo(axArcReaderControl1.CurrentARTool);<BR>      <CODE><FONT color=#008000>//Display the message property of the current tool in the status bar</FONT></CODE><BR>      StatusBar1.Panels[0].Text = arCommandInfo.Message;<BR>    }<BR>我想要在statusbar显示ButtonItem5和ButtonItem6,请问一下代码出错在哪里?谢谢!</P><img src="images/post/smile/dvbbs/em02.gif" />
喜欢0 评分0
kisssy
卧底
卧底
  • 注册日期2004-04-18
  • 发帖数235
  • QQ
  • 铜币614枚
  • 威望2点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2005-09-07 15:17
你是代码运行出错,还是statusbar未显示结果
个人专栏: https://zhuanlan.zhihu.com/c_165676639
举报 回复(0) 喜欢(0)     评分
asdp
路人甲
路人甲
  • 注册日期2004-10-20
  • 发帖数11
  • QQ
  • 铜币151枚
  • 威望0点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
2楼#
发布于:2005-09-07 15:38
谢谢。代码运行时不提示错误,但在最后跳出让我调试的对话框,我觉得是 <CODE><FONT color=#0000ff>if</FONT></CODE> (axArcReaderControl1.CurrentViewType == esriARViewType.esriARViewTypeMap)<BR>      {<BR>        <CODE><FONT color=#0000ff>if</FONT></CODE> (axArcReaderControl1.CurrentARTool != esriARTool.esriARToolCustom)<BR>        {<BR>          axArcReaderControl1.CurrentARTool = esriARTool.esriARToolCustom;<BR>        }<BR>      }<BR>      <CODE><FONT color=#0000ff>else if</FONT></CODE> (axArcReaderControl1.CurrentViewType == esriARViewType.esriARViewTypePageLayout)<BR>      {<BR>        <CODE><FONT color=#0000ff>if</FONT></CODE> (axArcReaderControl1.CurrentARTool != esriARTool.esriARToolCustom )<BR>        {<BR>          axArcReaderControl1.CurrentARTool = esriARTool.esriARToolCustom;<BR>        }<BR>      }<BR>的问题,但又不知道错在哪
举报 回复(0) 喜欢(0)     评分
dan800913
路人甲
路人甲
  • 注册日期2005-01-10
  • 发帖数102
  • QQ
  • 铜币617枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2005-09-07 17:17
我觉得是你的这句IARCommandInfo arCommandInfo = axArcReaderControl1.get_ARCommandInfo(axArcReaderControl1.CurrentARTool);<BR>出错了,应该是把CurrentARTool改为currenttool,再试试!
举报 回复(0) 喜欢(0)     评分
echodjx
路人甲
路人甲
  • 注册日期2004-06-06
  • 发帖数37
  • QQ
  • 铜币29枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2005-10-13 09:02
<P>有没有修改好,透露一下解决方法及结果。</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部