This document is archived and information here might be outdated.  Recommended version.


Creating different kinds of custom elements (ArcObjects .NET 10.4 SDK)

Creating different kinds of custom elements


In this topic


Creating point, line, and fill graphic elements

Generally, one-dimensional and two-dimensional elements do not need to account for AutoTransformation in their ITransform2D methods, as it is the shape (geometry) of the element that is transformed.
Implementing the appropriate symbol interface (IMarkerElement, ILineElement, or IFillShapeElement) improves integration with ArcGIS and automatically displays the appropriate Symbol property page to allow users to change the appearance of the element.

Creating a FrameElement

To add a neatline around an element, implement IFrameElement. The frame of a frame element generally surrounds another object (IFrameElement.Object), such as a map or legend, which knows how to draw itself.
FrameElements should also implement IFrameDraw and IFrameProperties. The IFrameDraw interface contains methods that are called to draw the parts of the element separately. First, the background (IFrameElement.DrawBackground) is drawn. Next, if IFrameElement.DraftMode is true, DrawDraftMode is called. With this method, add simple text to the name of the element. If DraftMode is false, IElement.Draw is called, at which point you draw the contained object over its background. Last, DrawForeground is called, at which point you draw the frame.
By implementing IFrameProperties, the frame property page applies to your element. If you create a property page that can be successfully applied to all frame elements, register the page to the ESRI Frame Element Property Pages component category rather than the ESRI Element Property Pages category. For example, existing frame element property pages provide a user interface for setting the background and border of IFrameElement. Otherwise, register the page to the ESRI Element Property Pages category.
The Triangle graphic element sample shows one way to create a custom element. If you're using this example as a template to create a different kind of element, consider the other element interfaces discussed in this topic.


See Also:

Creating custom elements
Samples:




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced
Engine Developer Kit Engine