When i open a form in visual studio 2005 (c#) the designer automaticaly resize the form and move/resize controls without touching the designer at all. The source file is changed and when i close the designer i'm asked to save the *.cs file. I tried to look into visual studio options without any success. any ideas? visual studio setup or something? thanks, Tal
You can resize individual controls, and you can resize multiple controls of the same or different kind, such as Button and GroupBox controls.
From the Solution Explorer window select your form, right-click, click on View Designer. Voila! The form should display. Save this answer.
VB.Net programmers have made extensive use of forms to build user interfaces. Each time you create a Windows application, Visual Studio will display a default blank form, onto which you can drag and drop controls from the Visual Studio Toolbox window.
Windows Forms Designer in Visual Studio provides a rapid development solution for creating Windows Forms-based applications. Windows Forms Designer lets you easily add controls to a form, arrange them, and write code for their events. For more information about Windows Forms, see Windows Forms overview.
I have been working on this problem for most of today and found some interesting things: The main source of the problem seems to be relying on anchoring. If I use docking to position my controls, instead of anchoring, my problems seem to go away. I found a couple of blog posts from 2003(!), which detail how you might use docking instead of anchoring, and explain how anchoring can break the Windows Forms designer. It seems like this problem might be over 7 years old!
Here are the posts:
This is due to AutoScaleMode
-property. Your forms have probably been designed with a different DPI or Font settings than you have now in Windows display settings. AutoScaleMode
-property has 4 different possible values : Dpi
, Font
, Inherit
or None
. In Dpi
or Font
mode, your forms and controls will be automatically resized depending on windows display settings.
So, set the AutoScaleMode
-property to None
in all your forms and controls and they won't be automatically resized anymore. Try to design your forms in order to let sufficient space in every controls so that text will fit even if text size is set to 125%.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With