How to get started with the MapControl property pages
Development licensing
Deployment licensing
Engine Developer Kit
Engine Runtime
ArcView
ArcEditor
ArcInfo
Getting started with the MapControl property pages
To get started, create a new project in Visual Studio:
Open Microsoft Visual Studio 2005.
Choose New Project from the File menu.
In the New Project dialog box, select either Visual Basic or Visual C# from the Project types, then Windows Application from the Templates to create a new Visual C# Windows Application or a new Visual Basic Windows Application.
In the New Project dialog box, name the project and click Browse to navigate to a location to save the project.
Choose Toolbox from the View menu to open the toolbox in Visual Studio.
In the toolbox, click the ArcGIS Windows Forms tab to show the controls in the following illustration:
Adding controls to the form
Click the MapControl icon in the toolbox. On the form, click and drag from one corner to the opposite corner to place the MapControl. Alternatively, double-click the MapControl icon in the toolbox to automatically place the MapControl on the form. Follow the same procedure to add the TOCControl, ToolbarControl, and LicenseControl icons to the form. Rearrange the control positions and resize the controls to look similar to the following:
Right-click the MapControl and choose Properties. The Properties dialog box appears. Click the General tab in the Properties dialog box, then click the Open folder button next to the Map Document field. See the following:
After the Open folder button is clicked, the Open dialog box appears. In the Open dialog box, navigate to a folder containing the map document. Select the map document and click the Open button.
In the Properties dialog box click Apply to link the map document to the MapControl, then click OK to close the Properties dialog box.
Right-click the TOCControl and choose Properties to open the TOCControl Properties dialog box.
Click the General tab and select AxMapControl1 from the Buddy Control dropdown list, then click the Apply button. See the following:
Click OK to close the TOCControl Properties dialog box.
Right-click the ToolbarControl and choose Properties to open the ToolbarControl Properties dialog box. Click the General tab and select AxMapControl1 from the Buddy Control dropdown list, then click the Apply button.
Click the Items tab in the ToolbarControl Properties dialog box and click the Add button to open the Control Commands dialog box.
Click the Toolsets tab in the Control Commands dialog box, and either double-click the Map Navigation toolset, or drag and drop the toolset onto the Properties dialog box with the Items tab selected. Repeat to add any other commands, toolsets, menus or palettes, then click Close in the Control Commands dialog box. See the following:
With the Items tab still selected in the ToolbarControl Properties dialog box, click to choose an item. Drag and drop the selected item to a new position on the ToolbarControl (selection is indicated by the black outline around the item), or drag and drop an item off the ToolbarControl to remove it. Right-click an item to delete it or set its style, group, or group spacing, then click Apply. See the following:
Click OK to close the Properties dialog box for the ToolbarControl.
Right-click the LicenseControl and choose Properties. The Properties dialog box for the LicenseControl appears.
Click the License tab, then select the ArcGIS Engine, ArcView, ArcEditor, and ArcInfo check boxes under Products.
Select the Shutdown this application if the selected licenses are not available check box, then click the Apply button. See the following:
Click OK to close the Properties dialog box for the LicenseControl.
To build the solution, choose it from the Build menu.
Choose Start Debugging from the Debug menu to run the application. Toggle layer visibility by interacting with the check boxes on the TOCControl. Select a tool on the ToolbarControl and use it to interact with the MapControl. See the following: