AnsweredAssumed Answered

ArcObjects: Programmatic adding of a data frame?

Question asked by Interfly on May 17, 2019
Latest reply on May 23, 2019 by Interfly

Hi all,

I  used .NET snippet to add a data frame into ArcMap as bellow:

...

Dim pmap As IMap=mxDocument.maps.Create()

pmap.Name="New DataFrame"

mxDocument.Add(pmap)

pmap.AddLayer(pLayer)

mxDocument.UpdateContents()

mxDocument.ActiveView = pmap

mxDocument.ActiveView.Refresh()

...

 

The newly created data frame 'New DataFrame'  and it's features can be displayed in ArcMap, but it seems not a 'Normal' DataFrame. It can't be double clicked to show property, it doesn't shown in pagelayout and even can't be removed in ArcMap interface..

 

Maybe what code is missed?

Outcomes