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

4420
11
09-29-2015 08:48 PM
SaurabhGupta5
Frequent 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
JonMorris2
Frequent Contributor

Hi Saurabh,

Sorry, I've been talking about minimum size when you wanted the maximum size to be set. It looks like this property is ignored too though. You'll just have to design your dockable window with this in mind and hope users don't stretch it out too much. At least all the other dockable windows have the same problem, so you're not alone.

Have you tried putting all your controls into a panel, so at least they stay together?

0 Kudos
SaurabhGupta5
Frequent Contributor

Thanks Jon for your prompt response...

Yes, i have tried out  all the ways but my design wants it to be non-resizable. I believe there is something which we can use to stop this resizing but unfortunately i am not able to find it out .... i still want to hear from someone , may be someone has came across this and resolved this.

Best Regards

0 Kudos