Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 981485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:32:58+00:00 2026-05-16T04:32:58+00:00

I have an application that was started in C# 1.0 using Visual Studio .NET.

  • 0

I have an application that was started in C# 1.0 using Visual Studio .NET. As part of a partial rewrite/upgrade, I would like the application to take advantage of the form auto-scaling features in Windows Forms 2.0. Those features rely on setting the AutoScaleDimensions property, which is supposed to be done by the designer. New custom Forms that I add to the project are set up with the correct designer code, but all my existing forms and controls do not auto-generate this property, and thus do not get auto-scaled correctly. I believe this is because the old forms were created with the old VS2002 project format, where all designer-generated code gets dumped into the same file as user created code; modern WinForms applications, of course, get split into multiple files by VS.

My question: is there any known way to “upgrade” an old Windows Forms project to the modern Visual Studio formats? (The project files have been upgraded to VS2010 formats, but the forms themselves still utilize the mono-file format.) I would like VS to generate the AutoScaleDimensions property by default and not have to initialize the property by hand.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:32:59+00:00Added an answer on May 16, 2026 at 4:32 am

    You are not going to get help converting the form class to a partial class. There really isn’t any need to, the designer still supports the old style. If editing the form layout doesn’t automatically insert the property assignment then just paste it in yourself, just before the ClientSize assignment. Try it out on a sample project first, just drop a button on the form and look at the Designer.cs file content. It ought to resemble:

            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(...)
            // etc..
    

    You can try it out to see if the form scales properly without having to reboot your machine by pasting this in your form’s code:

        protected override void OnLoad(EventArgs e) {
            this.Font = new Font(this.Font.FontFamily, 125f / 96 * this.Font.SizeInPoints);
            base.OnLoad(e);
        }
    

    Tinkering with layout properties might be necessary to make it look good.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Visual Studio 2010 with .NET 4.0. I have just started using
I have an application that I started with the Utility Application template. I'm using
I have an application that started life as an MVC (1.0) app in Visual
I have several WinForms .NET programs that are started using ClickOnce. The user logs
I am using Quartz.Net to schedule task. I have tried like wise. Started a
I have recently started using Visual studio 2010 ,so I'm unaware of its various
I wrote an application using Visual Studio 2010 that I configured to run using
I have been using the embedded server that visual studio has to test my
I just started writing a customer application in C#, using Visual Studio design mode
I just started to use SQL Server 2008. I have a winforms application that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.