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 3458490
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:59:21+00:00 2026-05-18T09:59:21+00:00

Everytime I move to Designer View my whole designer.cs code is messed up :

  • 0

Everytime I move to Designer View my whole designer.cs code is messed up :
VS Designer reorganizes code blocks and puts an irritant verbose prefixes like “this.whatever”
and fully qualifies objects using “System.Windows.Forms.whatever”
I Know that “Designer.cs” is not intended to be edited but I need to do some GUI code customization from time to time and would like these to stay as I changed them.

How to avoid that ? (Guess this is too funky for VS to handle)

(Actually I am just avoiding the use of the designer and do it all by hand, the good old way)

Update :
I am surprised to see the herd-like reaction towards this question. Sorry if it is disturbing, but it is interesting to see that, before hitting me on the hand saying “DON’T DO that, it’s Bad”, NO ONE asked WHY I wanted to do it.
IMHO the question is relevant and that’s why : Many of the “auto-generated” code is rubbish and of absolutely no use, it does need some enhancement. One example (among soooo many others) : Why generate a Size/Location property when the control’s Dock Mode is set to Fill ? I wanted to take advantage of the benefits whithout the drawdowns.
Anyway, I’ll keep the short answer : You take it ALL (with the rubbish) or leave it ALL.

  • 1 1 Answer
  • 0 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-18T09:59:22+00:00Added an answer on May 18, 2026 at 9:59 am

    It’s simple: don’t edit the designer code. Those warnings are there for a reason, and for Visual Studio to work correctly it needs to own that file.

    This is a partial class: everything you need to do, you can do in the matching non-designer file for that class; this includes all your control declarations and other things. Since you’re trying to avoid the designer entirely, let visual studio have that file and just put everything in your normal .cs file.

    Update:
    Based on the comment, I want to add the following —
    Either use the designer or don’t use the designer. Don’t be wishy-washy about it. If you’re using and relying on the designer for some things, you MUST leave the designer’s file alone.

    If you’re avoiding the designer, then really avoid the designer. Everything it does you can do in your own code (except of course for the visual queues, but even that can be done better via prototyping). You can even create your own additional file for the partial class to keep designer-like code in.

    If you’re only using the designer as an occasional code generator to help reduce some boring typing, do that in a separate project or on a throw-away form in your existing project and just copy/paste the code over.

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

Sidebar

Related Questions

Everytime I run the program, this mysterious error pops up saying that I have
I'm new to WPF, and I get error everytime I run my code DoubleAnimation
i'm using this code below to drag an image across the screen. The one
I don't know why this is happening... But, every time I open the designer
I am creating 2D game with OpenGL. Everytime I move my object, I have
Everytime I open VS 2010 I get this: The automatically saved settings file 'visual
I'm working on this web application that manages a DB. Everytime I go to
Everytime I layout all my controls in a UIView, and then forget they need
everytime my page loads, im supposed to create a datatable (also a jquery plugin)
Everytime the program loads, I need a dictionary to have about 15 values. Right

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.