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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:38:21+00:00 2026-05-30T03:38:21+00:00

I am looking over someone Else’s code and noticed that some of the user

  • 0

I am looking over someone Else’s code and noticed that some of the user control items have Class.Designer.cs and Class.resx files while others only have the .resx file. Is there a way I can add a .cs file to the controls with only a .resx file?

Why/how would this occur?

Is there any difference between the two? It looks like designer code is in the Designer.cs file while the UC with only has .rexs has all the code in a single .cs file.

Thanks!

  • 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-30T03:38:23+00:00Added an answer on May 30, 2026 at 3:38 am

    Some people automatically delete the Class.Designer.cs file when creating User Controls and Forms. If they do this, then the code to manage the placement of controls on the Form and such are not longer separated into a partial class, but are instead included into the code behind of the Class.cs file.

    For example here is Form 1.designer.cs.

    namespace WindowsFormsApplication1
    {
        partial class Form1
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
    
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            #region Windows Form Designer generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.panel1 = new System.Windows.Forms.Panel();
                this.SuspendLayout();
                // 
                // panel1
                // 
                this.panel1.Location = new System.Drawing.Point(49, 87);
                this.panel1.Name = "panel1";
                this.panel1.Size = new System.Drawing.Size(200, 100);
                this.panel1.TabIndex = 0;
                // 
                // Form1
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(284, 262);
                this.Controls.Add(this.panel1);
                this.Name = "Form1";
                this.Text = "Form1";
                this.ResumeLayout(false);
    
            }
    
            #endregion
    
            private System.Windows.Forms.Panel panel1;
        }
    }
    

    If I create another form, but delete the designer file, you will see this sort of code will go into the Form1.cs code file instead:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            private Panel panel1;
    
            public Form1()
            {
                InitializeComponent();
            }
    
            private void InitializeComponent()
            {
                this.panel1 = new System.Windows.Forms.Panel();
                this.SuspendLayout();
                // 
                // panel1
                // 
                this.panel1.Location = new System.Drawing.Point(101, 62);
                this.panel1.Name = "panel1";
                this.panel1.Size = new System.Drawing.Size(200, 100);
                this.panel1.TabIndex = 0;
                // 
                // Form1
                // 
                this.ClientSize = new System.Drawing.Size(284, 262);
                this.Controls.Add(this.panel1);
                this.Name = "Form1";
                this.ResumeLayout(false);
    
            }
        }
    }
    

    This doesn’t cause any harm, however having the code that deals with the form controls in a different file keeps your code looking leaner and cleaner and is therefore easier to navigate and manage.

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

Sidebar

Related Questions

I am looking over some code someone else did and I see this: if
While looking over some code, I found a function that seems to do exactly
I have been looking over this code for the past hour, I cant see
I was looking over some (C++) code and found something like this: //Foo.cpp namespace
I am taking over someone elses code. What are some good ways to learn
I'm looking over the Cloud Haskell package's Encoding.hs , and encountered some strange code
I am looking forward to find a jQuery code that allows me to have
I'm looking over my syllabus for my theoretical computer science class and within the
I was looking over this code to calculate math.sqrt in Java. Why did they
I'm looking over .NET ORM implementations, and I have a major burning question -

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.