private void RecoverPanelShow(int width) { Control control = PanelShow.Controls[PanelShow.Controls.Count - 1]; if (control.GetType() == typeof(PropertyTableForm)) { PanelShow.Controls.Remove(control); picBoxMap.Width += width; UpdateMapImg(); } control.Dispose(); propertyPanel = null; }
/// <summary> /// 打开属性表 /// </summary> private void OpTBToolStripMenuItem_Click(object sender, EventArgs e) { if (PanelShow.Controls.Count > 1) { RecoverPanelShow(PanelShow.Controls[PanelShow.Controls.Count - 1].Width); } treeViewLayers.SelectedNode.ContextMenuStrip = null; int layerIndex = treeViewLayers.SelectedNode.Index; MyLayer layer = myMap.Layers[layerIndex]; if (layer.DataType != MySpaceDataType.MyGrid) { propertyPanel = new PropertyTableForm(layer, layerIndex); propertyPanel.TopLevel = false; PanelShow.Controls.Add(propertyPanel); propertyPanel.Height = PanelShow.Height; propertyPanel.Location = new Point(PanelShow.Width - propertyPanel.Width, 0); propertyPanel.ClosingFormCompleted += new PropertyTableForm.ClosingFormDelegate(RecoverPanelShow); propertyPanel.SelectFeatureChanged += new PropertyTableForm.SelectFeatureChangedDelegate(changeSelectionFeatures); picBoxMap.Width = PanelShow.Width - propertyPanel.Width; propertyPanel.Show(); UpdateMapImg(); } }