I have code that creates new Data Frames, using IMaps.Create() and when you right click->Properties on the new Data Frames in ArcMap TOC, it never opens up the Properties window?! Anyone know whats going on here, have I missed something in the code?
The code is fairly basic:
internal static void AddNewMap(string mapName)
//Makes the new map the active focus map too.
IMxDocument mxd = ArcMap.Document;
IMaps maps = mxd.Maps;
IMap map = null;
if (maps.Count == 1 && maps.Item.Name != "Foo Name")
map = maps.Item;
map = maps.Create();
map.Name = mapName;
IActiveView pActiveView = ArcMap.Document.ActiveView;
if (pActiveView is IPageLayout)
ArcMap.Document.ActiveView.FocusMap = map;
ArcMap.Document.ActiveView = (IActiveView)map;
Solved! Go to Solution.
I'm finding that in Visual studio 2015 and ArcGIS 10.5.1 the IMaps.Add() method is hidden. It doesn't show up in intelisense and shows an error when typed out, but it still works and was the piece I was missing. Thank you, your code helped me figure it out.