private void expandScenario(string scenarioName) { //collapse all data frames for (int i = 0; i < m_maps.Count; i++) { m_maps.Item.Expanded = false; } //expand the scenario's data frame for (int i = 0; i < m_maps.Count; i++) { if (m_maps.Item.Name == scenarioName) { m_maps.Item.Expanded = true; } } activateDataFrame(scenarioName); }
If the selected element is one of the layers, the dataframe with the selected layer stays expanded.
private void expandScenario(string scenarioName) { //collapse all data frames for (int i = 0; i < m_maps.Count; i++) { IGraphicsContainerSelect graphics = (IGraphicsContainerSelect)m_maps.Item; graphics.UnselectAllElements(); m_maps.Item.Expanded = false; } //expand the scenario's data frame for (int i = 0; i < m_maps.Count; i++) { if (m_maps.Item.Name == scenarioName) { m_maps.Item.Expanded = true; } } activateDataFrame(scenarioName); }
Dim mxd As IMxDocument Set mxd = ThisDocument Dim ctView As IContentsView Set ctView = mxd.ContentsView(0) ctView.RemoveFromSelectedItems (ctView.SelectedItem) Dim i As Integer For i = 0 To mxd.Maps.Count - 1 mxd.Maps.Item(i).Expanded = False Next mxd.UpdateContents
Sub test() Dim mxd As IMxDocument Set mxd = ThisDocument Dim i As Integer For i = 0 To mxd.Maps.Count - 1 mxd.Maps.Item(i).Expanded = False Next mxd.UpdateContents End Sub
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.