Control resizing of ESRI.ArcGIS.Desktop.AddIns.DockableWindow

3722
11
09-29-2015 08:48 PM
SaurabhGupta5
Occasional Contributor

Hello Everyone,

I need a quick help on stop resizing of dockable window. I have added WPF user control as a child to this esri dockable window and i want user cannot resize this on arcmap. It should be of fixed width. How can i achieve the same ?

Here is the code for reference

public class AddinImpl : ESRI.ArcGIS.Desktop.AddIns.DockableWindow

        {

            private System.Windows.Forms.Integration.ElementHost m_windowUI;

            public AddinImpl()

            {

            }

            protected override IntPtr OnCreateChild()

            {

                m_windowUI = new System.Windows.Forms.Integration.ElementHost();

                m_windowUI.Child = new dckSafeDevt();

                //m_windowUI.MaximumSize = new System.Drawing.Size(305, 500);

                return m_windowUI.Handle;

            }

            protected override void Dispose(bool disposing)

            {

                if (m_windowUI != null)

                    m_windowUI.Dispose();

                base.Dispose(disposing);

            }

        }

dckSafeDevt is the xaml usercontrol.

Regards

0 Kudos
11 Replies
SaurabhGupta5
Occasional Contributor

I am still not able to find any clue on above issue. Please help

0 Kudos
SaurabhGupta5
Occasional Contributor

Waiting for suggestions!! Can anyone please help me on this one.

Thanks

0 Kudos
SaurabhGupta5
Occasional Contributor

please help me out

0 Kudos
SaurabhGupta5
Occasional Contributor

Hi,

Anyone from arcobjects can suggest something on this please . Have anyone done anything similar like this?

Regards

0 Kudos
SaurabhGupta5
Occasional Contributor

really no help on this post

0 Kudos
JonMorris2
Occasional Contributor II

I don't know about WPF, but we have a windows forms dockable window and a lot of the minimum size properties are blocked when you add the form to Arcmap. When I open my form as a standalone project, the minimum height and width settings are obeyed, but when it is added to Arcmap, you can compress the form right down until it is almost invisible.

0 Kudos
SaurabhGupta5
Occasional Contributor

Hi Jon,

Thanks for replying but what do you mean by compressing the form?

Regards

Saurabh

0 Kudos
JonMorris2
Occasional Contributor II

Sorry, I mean when you are resizing the application window. As a standalone application, you can pull the top edge of the window towards the bottom of the screen and it stops moving when the form reaches the minumum size.

With ArcMap, you can just keep pulling it down until it's just the window border.

ThinArcMap.png

Keep going...

ThinnerArcMap.png

0 Kudos
SaurabhGupta5
Occasional Contributor

Hi Jon,

I dont know whether below screen will help you in defining my problem or not but still i want to share , please have a look.

INITIAL LOAD:

intialload.JPG

AFTER RESIZE:

afterresize.JPG

I want to stop this resizing . i want this dockable window to  be fixed width ..

Regards

Saurabh

0 Kudos