18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BUILDING APPLICATIONS WITH ACTIVEX<br />

m_pCustomizeDialog.ShowAddFromFile = True<br />

' Set the ToolbarControl that new items will be added to.<br />

m_pCustomizeDialog.SetDoubleClickDestination ToolbarControl1<br />

End Sub<br />

3. Call the CreateCustomizeDialog subroutine from the Form_Load event before<br />

the call to the CreateOverviewSymbol subroutine.<br />

Private Sub Form_Load()<br />

' Create the customize dialog box for the ToolbarControl.<br />

CreateCustomizeDialog<br />

' Create symbol used on the MapControl…<br />

End Sub<br />

4. Add a check box to the Form and give it the name “chkCustomize” and the<br />

caption “Customize”.<br />

5. Add the following code to the chkCustomize_Click event.<br />

Private Sub chkCustomize_Click()<br />

' Show or hide the customize dialog box.<br />

If chkCustomize.Value = 0 Then<br />

m_pCustomizeDialog.CloseDialog<br />

Else<br />

m_pCustomizeDialog.StartDialog ToolbarControl1.hWnd<br />

End If<br />

End Sub<br />

6. Add the following code to the m_pCustomizeDialogEvents_OnCloseDialog<br />

and m_pCustomizeDialogEvents_OnStartDialog events.<br />

Private Sub m_pCustomizeDialogEvents_OnCloseDialog()<br />

ToolbarControl1.Customize = False<br />

chkCustomize.Value = 0<br />

End Sub<br />

Private Sub m_pCustomizeDialogEvents_OnStartDialog()<br />

ToolbarControl1.Customize = True<br />

End Sub<br />

7. Run the application and check the Customize box to put the ToolbarControl<br />

into customize mode and open the Customize dialog box.<br />

8. On the Commands tab select the Graphic Element category and double-click<br />

the Select Elements command to add it to the ToolbarControl. By right-<br />

300 • <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!