Abstract: This document describes how to use the mapcontrol, pagelayoutcontrol, toolbarcontrol, and toccontrol controls to create basic desktop GIS applications. Program Framework.
Copyright:
ArcGIS Engine + C # instance development tutorial is 3sdn (Http://www.3sdn.net) Original tutorial, All rights reserved. Commercial purposes are prohibited (if necessary, contact the author). for non-commercial purposes, indicate the source. The tutorial uses the C # language and vs2005 as the development tool.
Target audience:
ArcGIS Engine (AE) Development beginner,Understand the basic AE system, C # basic syntax, and basic usage of vs2005.
Expected learning results:
Further understand the architecture and development methods of AE and master the development of basic GIS desktop applications.
Tutorial directory:
First, the establishment of the desktop GIS application framework
Ii. Menu addition and implementation
Third, synchronize mapcontrol with pagelayoutcontrol
Lecture 4 Add and implement status bar Information
Fifth, the implementation of eagleeye
Sixth, right-click menu addition and implementation
Tutorial bug and optimization solution 1
7. Implementation of layer symbol selector 1
7. Implementation of layer symbol selector 2
Lecture 8 query and display of attribute data tables
------------------------------------------------------------------
Lecture 1: Establishment of the desktop GIS application framework
This article mainly uses the mapcontrol, pagelayoutcontrol, toolbarcontrol, and toccontrol controls to build a basic desktop GIS application framework. The final result is previewed as follows:
1. Create a project
Start vs2005, select "file | new | Project", select Visual C # in the project type, select the Windows Application Template, enter the name "3sdnmap", and click "OK.
In solution manager, rename "form1.cs" to "3sdnmap. cs". In Design view, select the form and change "text" in its properties to "3sdnmap ".
2. Add controls
select "menu and toolbar | menustrip" in the toolbox ", drag it into the form.
select the "ArcGIS Windows Forms" section in the Toolkit, drag the "toolbarcontrol" control into the form, and set the dock in its properties to top.
select "menu and toolbar | statusstrip" in the toolbox and drag it into the form.
drag the "container | splitcontainer" container in the toolbox into the form and set the dock in its properties to fill.
drag the tabcontrol control into Panel1, set the alignment attribute to bottom, and the dock attribute to fill. Click the button on the right of the tabpages attribute to bring up the tabpage Set editor. Set tabpage1 name to tabpagelayer, text to layer, tabpage2 name to tabpageproperty, and text to attribute. As shown below.
select the "layers" tab, drag the toccontrol control, and set the dock attribute to fill.
select the "properties" tab, drag the datagridview control, and set the dock property to fill.
drag the tabcontrol Control to panel2 and set the dock attribute to fill. In the preceding method, the name and text of the two tabs are set to: (tabpagemap, MAP) and (tabpagelayout, plate making ).
select the "map" tab, drag the mapcontrol control, and set the dock attribute to fill.
select the "plate making" tab, drag the pagelayoutcontrol Control, and set the dock attribute to fill.
Finally, drag the licensecontrol control to any part of the form.
press F5 to compile and run the program. The displayed program interface is displayed.
3. Control binding
The controls added through the above steps still exist independently, and our programs need to work collaboratively between controls, so control binding is required.
Right-click the toolbarcontrol and toccontrol controls and set buddy to axmapcontrol1, as shown in.
In this way, the toolbar and layer control are associated with the map control.
4. Add a tool
At this time, there are no tools in the toolbar, and the method to add is also very simple. Right-click toolbarcontrol, select "properties | items", click Add, select generic in the commands tab, and double-click open, saveas, redo, and undo to add the corresponding tool to the toolbar.
Common tools include:
The navigation tool in map navigation, the query tool in map inquiry, and the selection tool in feature selection. You can add the tool as needed.
5. Compile and run
Press F5 to compile and run the program. Now the basic framework of the desktop GIS application framework has been set up. You can use the tool bar to open the map document and browse the map. The effect is shown in the beginning.