参考DeskTop帮助文档 准备:添加一个Button控件Tools—>Customize—>Commands tab—> UIControl—>IButtonControl在该Button的Click事件中添加以下代码:Dim pWorkspaceFactory As IWorkspaceFactorySet pWorkspaceFactory = New ShapefileWorkspaceFactoryDim pWorkSpace As IFeatureWorkspace’Change ‘e:\street’ to the source location of the shapefile you wish to addSet pWorkSpace = pWorkspaceFactory.OpenFromFile("e:\street", 0)Dim pClass As IFeatureClass’Change polygon to the name of the shapefile you wish to addSet pClass = pWorkSpace.OpenFeatureClass("polygon")Dim pLayer As IFeatureLayerSet pLayer = New FeatureLayerSet pLayer.FeatureClass = pClasspLayer.Name = pClass.AliasNameDim pMxDoc As IMxDocumentSet pMxDoc = ThisDocumentpMxDoc.AddLayer pLayerpMxDoc.ActiveView.PartialRefresh esriViewGeography, pLayer, Nothing 不要因为世态变迁而埋怨,不要因为命运多舛而怨恨.
VBA之添加Shape图层
相关文章:
你感兴趣的文章:
- Java之网络编程案例讲解
- 家用路由器有哪些可以推荐(路由器家用推荐)
- 继电保护的四性
- iPhone 14 Pro是曲面屏吗
- 飞利浦55PUF6301/T3的外观设计怎么样?
- 搭建内部openwrt Git仓库