/// <summary> /// 根据ID显示指定的DockWindow /// </summary> /// <param name="uid_value">UID.Value,一般为“ThisAddIn.IDs.xxxx”格式,其中“xxxx”为DockableWindow的ID</param> internal static void ShowDockAbleWindow(string uid_value) { if (DateTime.Now > new DateTime(2019, 8, 31)) { ShowDialogInfo("插件已过期"); return; } IDockableWindowManager pDocWinMgr = ArcMap.DockableWindowManager; UID uid = new UIDClass() { Value = uid_value }; IDockableWindow pWindow = pDocWinMgr.GetDockableWindow(uid); if (!pWindow.IsVisible()) { pWindow.Dock(esriDockFlags.esriDockShow); } else { pWindow.Dock(esriDockFlags.esriDockUnPinned); } }
protected override void OnClick() { try { //Get dockable window UID dockWinID = new UIDClass(); dockWinID.Value = ThisAddIn.IDs.DockableWindow1; IDockableWindow s_dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); s_dockWindow.Caption = "面板1"; s_dockWindow.Dock(esriDockFlags.esriDockTabbed); s_dockWindow.Show(true); } catch (Exception ee) { MessageBox.Show(ee.Message + " " + ee.StackTrace); } }