Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Design Time or Compiler Bug? Form Resizing But Not Resizing Anchored Controls
 

Design Time or Compiler Bug? Form Resizing But Not Resizing Anchored Controls

I'm pretty sure this is either a bug but just in case I figured I'd ask my fellow developers.

I have a WinForm that has a max size (735,1200) and a minimum size (735, 554) specified. On this form is a series of panels that contain all of the user modifiable contols. These panels are anchored to the various sides of the form and when the form grows or shrinks the anchoring works properly.

There is, however,one problem. In the VS 2005 designer screen, if I resize the form to the minimum size of 735, 554, save the changes and then close the form, the next time I open the form in the designer the height has been reassigned to 580-- 26 pixels larger than what I had just saved it as. There is nothing in my code that tells the form to resize and other than the min and max form size properties, I haven't set any special properties on my form that deal with sizing.

Another odd thing is that when I open the form in the designer and I see that the form has been resized, the anchoring has been ignored. Theres a big gap between the bottom panel on the form and the bottom edge of the form.

Am I missing something? Could something be causing this that I am unaware of? This program is an inter-company application and it is frequently updated through a ClickOnce publication system. Having a form that constantly resizes itself without adjusting it's control positions and sizes just looks unprofessional in my opinion. Can anyone help?

Thanks for the help!

RHartness  Wednesday, June 13, 2007 8:31 PM

[bump]

Does any body have any clue?

RHartness  Thursday, June 14, 2007 8:18 PM

I found the patch.

Download .net Framework 1.1 Service Pack 1

which will solve the problem

Keyurshah_79  Tuesday, June 19, 2007 11:38 PM

Thanks for the help, but it is already is installed. To be sure, I downloaded the install application for .NET 1.1 Service Pack 1 and tried to install it. It informed me that it was already on my computer.

Could this be anything else that you are aware of?

RHartness  Wednesday, June 20, 2007 12:22 PM
I'm having the same problem... Visual Studio 2005. I'm working with a form that is 1280 x 1024. Every time I open it in the designer, it changes the height of the form to 1002. I haven't found any way to stop it from doing this.
JOZZ  Wednesday, June 20, 2007 8:32 PM

I have a similar but opposite problem where my Form does not resize but the anchored controls do. Did you ever find out what was going on in your situation?

spanky4_3  Tuesday, May 06, 2008 6:25 AM

Aha! This is what happens when I don't follow up with my own threads when I eventually answer them myself. I recall fixing the problem but since that was 10 months ago I can't recall the specifics of the solution.

Here is what I vaguely recall trying. First, I believe after I made my last post, I actually attempted uninstalling and reinstalling the .NET 1.1 framework. CurrentIy, Ialso see in my list of installed applications that I have .NET Framework 1.1 Hotfix (KB928366) installed. I'm not sure if this was part of an automatic Windows update of if I found it some how and that solved the problem. If you don't have it, you might want to give that a try.

This was also only an issue for me in the Windows Form Designer that is within VS 2005. If I opened a form, saved it (without changing anything), closed it and reopened it the controls would be resized-- usually the height value would be less than it was initially set as. I know I messed around with the dock settings for some of my container controls and tweaked the initial sizes. That might have helped.

One other thing that you could check for, although it wasn't part of my problem, is to see if you've accidentally set the forms "Locked" property.

If the form is locked, it is possible that there is a bug in the designer/.NET framework that is affecting the size of your controls. I, personally, have never used the "Locked" Property-- I typically use the MaximumSize and MinimumSize values to lock the size of a Form.

Hope that helps.

RHartness  Tuesday, May 06, 2008 1:00 PM

After Installation of VS2003 we must install .Net Framework 1.1. Service Pack 1 . which will solve the probem of design time.

Keyurshah_79  Sunday, March 01, 2009 8:58 AM

You can use google to search for other answers

Custom Search

More Threads

• C# AccessViolationException when printing with 3rd party fileprinter
• Error in SELECT clause: expression near '['
• How to programmatically create resource (resx) file given control.
• Databindings UITypeEditor
• Problem with visual inheritance
• Strange Behaviour of Combobox created as Custom by inheriting from Actual
• Track the Shift Tab key in Textbox
• Using ToolStripControlHost with DateTimePicker
• How do I force the printer to print in grayscale mode from C#?
• How to prevent Designer from executing code in a UserControl's Load event.