This is a migrated thread and some comments may be shown as answers.

Fix the size of HostWindow

7 Answers 168 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Blue Chen
Top achievements
Rank 1
Blue Chen asked on 13 Jun 2011, 07:31 AM
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!

7 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 16 Jun 2011, 08:45 AM
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.
0
Blue Chen
Top achievements
Rank 1
answered on 17 Jun 2011, 09:29 AM
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?
0
Alexander
Telerik team
answered on 22 Jun 2011, 07:26 PM
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.
0
Steve
Top achievements
Rank 1
answered on 21 Dec 2011, 02:32 AM
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
0
Jack
Telerik team
answered on 23 Dec 2011, 04:18 PM
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.
0
Steve
Top achievements
Rank 1
answered on 27 Dec 2011, 06:24 PM
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.
0
Stefan
Telerik team
answered on 30 Dec 2011, 03:54 PM
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.
Tags
Dock
Asked by
Blue Chen
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Blue Chen
Top achievements
Rank 1
Steve
Top achievements
Rank 1
Jack
Telerik team
Stefan
Telerik team
Share this question
or