reecho
路人甲
路人甲
  • 注册日期2004-07-16
  • 发帖数31
  • QQ
  • 铜币184枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1942回复:5

[求助]添加文本,并能实现编辑

楼主#
更多 发布于:2005-09-19 10:23
  我在axmapcontrol里添加了一个文本,怎么样实现一添加上去就是可以编辑的状态呢(跟arcmap一样)?另外因为axmapcontrol的地图是从pagelayout里拷贝过来的,所以当按了pagelayout页再按axmapcontrol页时候就没有刚才添加的文本了,怎么实现两个控件地图内容是一致的呢?请各位多多达人指教!
喜欢0 评分0
linton_lau
路人甲
路人甲
  • 注册日期2005-04-19
  • 发帖数30
  • QQ
  • 铜币277枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2005-09-20 12:49
我也想知道。
举报 回复(0) 喜欢(0)     评分
kisssy
卧底
卧底
  • 注册日期2004-04-18
  • 发帖数235
  • QQ
  • 铜币614枚
  • 威望2点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2005-09-20 14:41
<P>先回答你第一个问题:</P>
<P>首先,我想问一下你是否用MapControl1.DrawText添加了文本,如果是这样的话,就会有点问题了,因为添加的并不是TextElement</P>
<P>你应该:</P>
<P>1、通过MapControl1.ActiveView.GraphicsContainer.AddElement添加TextElement</P>
<P>2、然后通过IGraphicsContainerSelect的SelectElement选择Element。<BR></P>
个人专栏: https://zhuanlan.zhihu.com/c_165676639
举报 回复(0) 喜欢(0)     评分
reecho
路人甲
路人甲
  • 注册日期2004-07-16
  • 发帖数31
  • QQ
  • 铜币184枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2005-09-20 17:55
<P>已经实现了,谢谢kissy.我还有个问题就是:</P>
<P>(1)如何实现像Arcmap里一样的功能:toccontrol对mapcontrol和pagelayoutcontrol都有效,一方改变的结果可以反映到另一方。如在mapcontorl里添加的textelement可以在pagelayoutcontrol里看到(我是用pagelayoutcontrol装载的地图,然后通过拷贝地图的方法到mapcontrol中的)</P>
<P>(2)在c#里,toolbarcontrol不能浮动,有人建议用别的控件做,但是activebar不支持c#03版本。有没有别的控件可以实现的呢?</P>
<P>谢谢回答!</P>
举报 回复(0) 喜欢(0)     评分
kisssy
卧底
卧底
  • 注册日期2004-04-18
  • 发帖数235
  • QQ
  • 铜币614枚
  • 威望2点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2005-09-20 19:03
<P>很抱歉reecho</P>
<P>两个问题都回答不了。</P>
<P>下面一段话是一个老外讲的(总体上感觉你的第一个问题比较麻烦)</P>
<P>The controls work differently than ArcMap. The MapControl does not automatically know about the PageLayoutControl because they do not share the same ActiveView. <BR><BR>Selecting features in the MapControl or drawing graphics in the MapControl will not select features/add graphics to the PageLayoutControl. You will need to programmatically make these selections and draw the graphics in the PageLayoutControl yourself. <BR><BR>Be careful when using ObjectCopt to copy a Map into the IActiveView::FocusMap property of the PageLayoutControl. If the PageLayout contains IMapSurroundFrames (north arrows, scalebars etc) that point to the IMapFrame containing the FocusMap, when that FocusMap is replaced the IMapSurroundFrames will then have invalid pointers to the FocusMap that has been replaced. <BR><BR>Using ObjectCopy to copy a Map into the MapControl as the sample does is OK, becasue the MapControl does not contain any other object like MapSurroundFrames that point to the map. <BR></P>
<P>如果用笨一点的方法,就在AddElement的时候,在MapControl和PageLayoutControl都调用一下AddElement</P>
个人专栏: https://zhuanlan.zhihu.com/c_165676639
举报 回复(0) 喜欢(0)     评分
reecho
路人甲
路人甲
  • 注册日期2004-07-16
  • 发帖数31
  • QQ
  • 铜币184枚
  • 威望0点
  • 贡献值0点
  • 银元0个
5楼#
发布于:2005-09-21 09:52
Thank you all the same,kissy!
举报 回复(0) 喜欢(0)     评分
游客

返回顶部