Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Dock > Fix the size of HostWindow

Not answered Fix the size of HostWindow

Feed from this thread
  • Blue Chen avatar

    Posted on Jun 13, 2011 (permalink)

    Hi,
    I tried to set a fixed size for a HostWindow just as ToolWindow. However, even I applied the following code, the width of the HostWindow is still changeable.   I am using Rad Controls for WinForms Q1 2010.
            
                DockTabStrip aHostWindow= (DockTabStrip)aHostWindow.TabStrip;
                aHostWindow.SizeInfo.SizeMode = SplitPanelSizeMode.Absolute;
                aHostWindow.SizeInfo.AbsoluteSize = new System.Drawing.Size(180, aHostWindow.SizeInfo.AbsoluteSize.Height);

    Thanks!

    Reply

  • Alexander Alexander admin's avatar

    Posted on Jun 16, 2011 (permalink)

    Hello Blue Chen,

    Thank you for your question.

    The AbsoluteSize of DockTabStrip will apply when RadDock is initially displayed and you will still be able to resize the window. To prevent the window from resizing, you can set minimum and maximum size of DockTabStrip:

    DockTabStrip dockTabStrip = (DockTabStrip)this.aHostWindow.TabStrip;
    dockTabStrip.SizeInfo.MinimumSize = new System.Drawing.Size(180, dockTabStrip.SizeInfo.AbsoluteSize.Height);
    dockTabStrip.SizeInfo.MaximumSize = new System.Drawing.Size(180, dockTabStrip.SizeInfo.AbsoluteSize.Height);

    I hope it helps.

    Best regards,
    Alexander
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.

    Reply

  • Blue Chen avatar

    Posted on Jun 17, 2011 (permalink)

    Hi Alexander,
    Thank you very much for your quick reply.
    I tried your solution and the width of the HostWindow became fixed. But a new problem came out: the height of the HostWindow was set to 200 and became uncontrollable. How to set the height of the host window appropriately?

    Reply

  • Alexander Alexander admin's avatar

    Posted on Jun 22, 2011 (permalink)

    Hello Blue Chen,

    Thank you for writing back.

    The solution illustrated in my previous post fixes both the width and height of the window. You can fix only its width using the following code snippet:

    DockTabStrip dockTabStrip = (DockTabStrip)this.aHostWindow.TabStrip;
    dockTabStrip.SizeInfo.MinimumSize = new System.Drawing.Size(180, 0);
    dockTabStrip.SizeInfo.MaximumSize = new System.Drawing.Size(180, 0);

    I hope it helps.

    Best regards,
    Alexander
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.

    Reply

  • Steve avatar

    Posted on Dec 20, 2011 (permalink)

    I am currently having an issue with setting the MinimumSize to anything. no matter what I set it to it will do nothing.

    private static readonly Size WindowSize = new Size(800, 540);
    this.Host.TabStrip.SizeInfo.AbsoluteSize = WindowSize;
    this.Host.TabStrip.SizeInfo.MinimumSize = WindowSize;

    Am I doing something wrong here?

    Thanks,

    Steve

    Reply

  • Jack Jack admin's avatar

    Posted on Dec 23, 2011 (permalink)

    Hello Steve,

    Your code looks OK. I tested it with our latest release Q3 2011 SP1 and with Q3 and everything looks OK. Maybe there is something related with your application. Please, could you send it to us. We will investigate the issue further and we will try to find a proper solution.

    I am looking forward to your reply.
     
    All the best,
    Jack
    the Telerik teamQ3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

    Reply

  • Steve avatar

    Posted on Dec 27, 2011 (permalink)

    Unfortunately I cannot send my program to you due to company regulations, but I am using 2011 Q2 still (can't upgrade till we're done with current version of our program). Could there have been a known issue with the minimum size in that release? Also if you know of any other code snippets that mat interest you I can probably send those.

    Reply

  • Stefan Stefan admin's avatar

    Posted on Dec 30, 2011 (permalink)

    Hi Steve,

    Thank you for writing back.

    I was not able to find any issues related to yours in the list with the resolved issues for the Service Pack. What I can suggest is to try to isolate the issue in a sample application and provide us with it. Alternatively, if you cannot manage to isolate the issue in a sample project, what we can do is to sing an Non Disclosure Agreement in order to allow you to provide us with your project without worrying about your intellectual property. No matter which approach you decide to go with, please open a support ticket and provide reference to this forum thread. The support thread will allow you to attach files and will protect any private data disclosure.

    Greetings,
    Stefan
    the Telerik teamQ3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Dock > Fix the size of HostWindow
Related resources for "Fix the size of HostWindow"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]