How to set MapControl properties


Summary
This topic shows how the various properties of the MapControl can be set by clicking a button. Use the Java Property Editor of the MapControl to set the visual properties and initialize the map document during design time.

Setting MapControl properties

Do the following to set MapControl properties:
  1. Create an ArcGIS Engine project in the Eclipse integrated development environment (IDE) using the MapControl. For more information, see How to build an application in Eclipse using visual beans. The following screen shot shows an example JFrame in design mode: 

  2. Right-click the MapControl and click Customize Java Bean. The Java Property Editor dialog box appears. The visual properties of the MapControl, such as border style, appearance, background color, mouse pointer, and ToolTip style can be set on the Java Property Editor dialog box. See the following screen shot:

  3. On the Java Property Editor dialog box, click the General tab. The following table explains the other areas that can be selected under the General tab:
Labels
MapControl methods
Description
Default value
Enabled
Indicates whether the MapControl can respond to user generated events.
True
Enable OLD Drop Event
Indicates if the MapControl fires events when data is dragged over the control's window.
False
Arrow Key Intercept
A property that specifies interception of key strokes that are normally handled by the container. When intercepted, the OnKeyDown and OnKeyUp events will be called.
0
Show Scrollbars
Indicates whether the map's scrollbar is visible.
True
Show Map Tips
Determines if MapTips display (if they exist) as the mouse pointer hovers over layer features.
False
Map Document
The file name of the last map document loaded into the control.
None
  1. Do the following to set the Map Document property on the Java Property Editor dialog box for the MapControl:
    1. Click the Open folder icon. The Open dialog box appears.
    2. On the Open dialog box, browse to the folder containing the map document.
    3. Select the applicable map document, then click Open. The file path of your selected document shows in the Map Document text field.

      Alternatively, the properties of the MapControl can also be modified using the Properties window in the Eclipse IDE. See the following screen shot:

       
The MapControl property editor avoids the redundant code that a developer might need to write multiple times. It presents a convenient interface for developers to initialize a simple ArcGIS Engine application.


See Also:

MapControl class
Using MapControl
How to build an application in Eclipse using visual beans




Development licensingDeployment licensing
Engine Developer KitEngine
ArcGIS for Desktop Basic
ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced