Fix the size of HostWindow

8 posts, 0 answers
  1. Blue Chen
    Blue Chen avatar
    3 posts
    Member since:
    Mar 2010

    Posted 13 Jun 2011 Link to this post

    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!
  2. Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 16 Jun 2011 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Blue Chen
    Blue Chen avatar
    3 posts
    Member since:
    Mar 2010

    Posted 17 Jun 2011 Link to this post

    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?
  5. Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 22 Jun 2011 Link to this post

    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.
  6. Steve
    Steve avatar
    4 posts
    Member since:
    Sep 2011

    Posted 20 Dec 2011 Link to this post

    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
  7. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 23 Dec 2011 Link to this post

    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.
  8. Steve
    Steve avatar
    4 posts
    Member since:
    Sep 2011

    Posted 27 Dec 2011 Link to this post

    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.
  9. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 30 Dec 2011 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready