0

In an ArcMap custom tool I used DockableWindow for user interaction. I want to set a size for the window while initial opening. I changed the height and width of InitialPlacement. After changing it looks like this.

  <DockableWindows>
    <DockableWindow id="First_DockableWindow" class="FirstComponent+AddinImpl" caption="First Component" image="Images\connected-component.png">
      <InitialPlacement height="600" width="500" state="unpinned" position="left" />
    </DockableWindow>
  </DockableWindows>

I experienced that it ignores the size whatever I set. Did I miss anything?

1
  • 1
    Some discussing about resizing on this thread, might be of help?
    – Hornbydd
    Oct 26, 2020 at 17:15

1 Answer 1

1

ArcMap caches the position, height, and width of floating and docked windows. I believe what's happening is that caching is overwriting your defaults. Try and delete the The C:\Users<user>\AppData\Roaming\ESRI\Desktop10.#\ArcMap\Templates\normal.mxt file or the entire ..\Roaming\ESRI and ..\Local\Esri folders. You may get the correct default size then.

If you want it to always open at the same size you can fetch the dockable window and set it's height and width like so:

UID dockWinID = new UID();
dockWinID.Value = ThisAddIn.IDs.MyDockId;
dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
(dockWindow as IWindowPosition).Height = 800;
(dockWindow as IWindowPosition).Width = 150;
3
  • Thank you @danielm, Already I have done it. Could you please let me know, how can I set Minimum and Maximum size of the dockable window?
    – osman
    Oct 29, 2020 at 8:25
  • I don't know. I'm not sure you can. You could probably try to get the underlying window handle and do something there, but you probably shouldn't. You're creating a dockable window, of which there are many in ArcMap. Users are going to expect your window to behave similarly. All this resizing goes out the window as soon as someone docks the window. It sounds more and more like you don't want a dockable window extension, but to create your own custom popup window.
    – danielm
    Oct 29, 2020 at 15:09
  • Okay, Thank you very much.
    – osman
    Oct 30, 2020 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.