| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 6 年前 | ||
| 6 年前 | ||
| 9 年前 | ||
| 6 年前 | ||
| 6 年前 |
Building a MapViewer application using the ArcGIS Engine controls
In this sample, the MapControl, PageLayoutControl, TOCControl, and ToolbarControl are used in conjunction with other ArcObjects and the control commands to create a Map Viewer application. This sample accompanies the [Building a map viewing application using the ArcGIS Engine controls](http://7bd52ed1-18ae-4aa7-8cde-e9eaed9537fe) walkthrough and demonstrates the following:
- Loading preauthored map documents into the PageLayoutControl and MapControl using the CheckMxFile and LoadMxFile methods.
- Setting the ToolbarControl and TOCControl buddy control to be the PageLayoutControl using the SetBuddyControl method.
- Resizing the MapControl and PageLayoutControl when the container form or dialog box is resized.
- Adding navigation and inquiry commands to the ToolbarControl using the AddItem method.
- Creating a pop-up menu from the commands that work with the PageLayoutControl and displays as a right-click context menu.
- Creating a palette of tools from the commands and adding it to the ToolbarControl.
- Managing the way map and layer labels are edited in the TOCControl using the LabelEdit property and the ITOCControlEvents.OnEndLabelEdit event.
- Using the MapControl as an overview window by using the DrawShape method to highlight the current extent of data in the PageLayoutControl.
- Creating a custom Add Date command that works with the PageLayoutControl, ToolbarControl, and MapControl.
- Customizing the ToolbarControl with the Customize property and displaying the CustomizeDialog to the end user at runtime.
- Persisting the ToolbarControl items using the SaveItems and LoadItems methods.
- Printing the contents of the PageLayoutControl using the PrintPageLayout method.
Language: C#, VB
Subject: Controls
Organization: Esri, http://www.esri.com
Date: 10/17/2019
ArcObjects SDK: 10.8
Visual Studio: 2017, 2019
.NET Target Framework: 4.5
Resources
- ArcObjects .NET API Reference online
- Sample Data Download
- What's new
- Download the ArcObjects SDK for .Net from MyEsri.com
Usage
- Open the .NET solution file and build the projects.
- Run the controls application.
- Use the Open Document command on the ToolbarControl to browse to a preauthored map document to load into the PageLayoutControl.
- Use the commands and tools on the ToolbarControl to navigate around the map document. Right-click the PageLayoutControl to display the pop-up menu. Use the palette on the ToolbarControl to draw graphic elements on the PageLayoutControl.
- Use the custom Add Date tool to add an element to the PageLayoutControl containing the current date.
- Click a map or layer label in the TOCControl, then click it again to edit the label.
- Customize the ToolbarControl by adding new commands, menus, or palettes from the CustomizeDialog. To alter the appearance of an existing item on the ToolbarControl, right-click the item to display the context menu. Stop running the application, then restart the application to see that the customizations you made were persisted.
- Print the contents of the PageLayoutControl by selecting Print from the File menu.
See Also
Walkthrough: Building a map viewing application using the ArcGIS Engine controls
Licensing
| Development licensing | Deployment licensing |
|---|---|
| Engine Developer Kit | Engine |
| ArcGIS Desktop Basic | |
| ArcGIS Desktop Standard | |
| ArcGIS Desktop Advanced |