初始化 LicenseControl 控件
8、右击 LicenseControl,选择 ActiveX-Properties,打开 LicenseControl 属性页;
9、选择产品许可级别,此处选择 ArcGIS Engine;
载入地图到 PageLayoutControl 和 MapControl 控件中
10、选择 Form_Load 事件,输入以下代码:
Private Sub MapViewer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Load a pre-authored map document into the PageLayoutControl using realative paths.
Dim sFileName As String = "D:\arcgis\ArcTutor\ArcReader and Publisher\Gulf of St. Lawrence.mxd"
If AxPageLayoutControl1.CheckMxFile(sFileName) Then
AxPageLayoutControl1.LoadMxFile(sFileName)
End If
End Sub
11、以 Design 模式显示 MapViewer 窗体,从属性窗口中选择 axPageLayoutControl1 控件,显示
PageLayoutControl events,双击 OnPageLayoutReplaced event,在代码窗口中添加一个 event handler:
Private Sub AxPageLayoutControl1_OnPageLayoutReplaced(ByVal sender As System.Object, ByVal e As
ESRI.ArcGIS.Controls.IPageLayoutControlEvents_OnPageLayoutReplacedEvent) Handles
AxPageLayoutControl1.OnPageLayoutReplaced
'Load the same pre-authored map document into the MapControl.
AxMapControl1.LoadMxFile(AxPageLayoutControl1.DocumentFilename)
'Set the extent of the MapControl to the full extent of the data.
AxMapControl1.Extent = AxMapControl1.FullExtent
End Sub
设置 TOCControl 和 ToolbarControl 控件的 buddy controls 属性
12、在 Form_Load event 中,输入以下代码:
评论3
最新资源