Reshaping and adding nodes programmatically – Pitney Bowes MapXtreme User Manual

Page 151

Advertising
background image

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

Editing a FeatureGeometry with the Select Tool

MapXtreme v7.1

151

Developer Guide

Reshaping and Adding Nodes Programmatically

This section describes how to reshape and add nodes programmatically. Code is provided in C# and
VB.

1. Add a button named "btnEditNodeTool" to the main form in the Visual Studio designer.

2. Double-click the button to open the button's handler in the code page. Add the appropriate code

sample:
VB example:
Private Sub btnEditNodeTool_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs)
MapControl1.Tools.LeftButtonTool = "Select"
MapControl1.Tools.SelectMapToolProperties.EditMode =
MapInfo.Tools.EditMode.Nodes
End Sub

3. Run the application.

4. Select the object's layer in the LayerControl.

5. On the Visibility tab of the LayerControl, select the Show Nodes check box.

6. On the Options tab, select the Selectable and Editable check boxes.

7. Click OK to accept the change.

8. Now click the new button you added to the form. The cursor will change to the Select arrow.

9. Select an object to modify, then click and drag on a node (as in

step 1

of the previous example).

Advertising