The maptoolbar – Pitney Bowes MapXtreme User Manual

Page 130

Advertising
background image

Chapter 7: Desktop Applications, Controls, Dialogs, and Tools

Key Controls to Use in Desktop Applications

MapXtreme v7.1

130

Developer Guide

All but two of the ToolStripButtons can be added to a ToolStrip or StatusStrip. The tools that display
the zoom level and scale of the current map view, can only be added to the StatusStrip.

To add a new ToolStripButton, in Visual Studio choose the ToolStrip from the toolbox under Menus
and Toolbars. A split button appears on the form displaying a small down arrow. Click the arrow to
display the list supported ToolStripButtons and choose what you need. Once added to the
MapControl, the tool is immediately associated with it.

The API for the ToolStripButtons is contained in the MapInfo.Windows.Controls namespace. The
abstract base class from which all the ToolStripButtons are derived is the
MapInfo.Windows.Controls.MapToolStripButtonBase, which in turn was inherited from the .Net
System.Windows.Controls.ToolsStripButton class.

For information on how to use the ToolStripButtons programmatically, view the code in the MapForm
template and visit the Developer Reference. For information on the behaviors of each tool, see the
individual MapTool classes in MapInfo.Tools namespace.

The MapToolBar

Beginning with version 7.0, the MapToolBar has been replaced in the MapForm template by a
ToolStrip. See

MapToolStripButtons

. The MapToolBar is still available in the Visual Studio toolbox.

This section outlines instructions on how to add a MapToolBar to a MapForm.

The MapToolBar combines several of the map tool controls (e.g., zoom in, open table) into a single
control. The default collection of tools includes: OpenTable, LayerControl, Select, ZoomIn,
ZoomOut, Pan, and Center.

To add a MapToolBar to your MapForm, drag it from the Visual Studio toolbox. (The MapToolBar is
no longer provided in the MapForm templates.)

Advertising