Howto: 怎样使用IGraphicContainer::FindFrame?

文章编号: 366
软件: ArcInfo Desktop 8.X 9.0, ArcEditor 8.X 9.0,ArcView 8.X 9.0
操作系统: N/A
已邀请:

EsriSupport

赞同来自:

摘要: 这个文档主要显示怎么样使用IGraphicContainer::FindFrame来找到包含特定的map的map frame。
内容: 1 打开ArcMap,打开Visual Basic Editor。
2 在工程浏览窗口,展开Project.mxt,选择ArcMap objects>This Document,右键并选择浏览代码。
在工程的ThisDocument代码模块中的代码将仅仅在现在的地图文档中使用。如果想存储你的代码在你的所有的地图文档中,那么使用Normal.mxt中的ThisDocument代码模块。
3 粘贴下面的代码到代码模块中:

Sub FindFrame()
Dim pDoc As IMxDocument
Dim pGraphicsContainer As IGraphicsContainer
Dim pMapFrame As IMapFrame

Set pDoc = ThisDocument
Set pGraphicsContainer = pDoc.PageLayout

'得到文档中第一个地图所在的Map Frame.

Set pMapFrame = pGraphicsContainer.FindFrame(pDoc.Maps.Item(0))
End Sub

4 关闭Visual Basic Editor,并测试运行代码。




创建时间:2004-11-07
最近更新:2004-11-07


原文链接
http://support.esrichina.com.cn/2004/1107/366.html

要回复问题请先登录注册