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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:38:35+00:00 2026-05-10T21:38:35+00:00

I have a control that is created like so: public partial class MYControl :

  • 0

I have a control that is created like so:

public partial class MYControl : MyControlBase {     public string InnerText {         get { return textBox1.Text; }         set { textBox1.Text = value; }      }     public MYControl()     {         InitializeComponent();     } }  partial class MYControl {     /// <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 Component 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.textBox1 = new System.Windows.Forms.TextBox();         this.listBox1 = new System.Windows.Forms.ListBox();         this.label1 = new System.Windows.Forms.Label();         this.SuspendLayout();         //          // textBox1         //          this.textBox1.Location = new System.Drawing.Point(28, 61);         this.textBox1.Name = "textBox1";         this.textBox1.Size = new System.Drawing.Size(100, 20);         this.textBox1.TabIndex = 0;         //          // listBox1         //          this.listBox1.FormattingEnabled = true;         this.listBox1.Location = new System.Drawing.Point(7, 106);         this.listBox1.Name = "listBox1";         this.listBox1.Size = new System.Drawing.Size(120, 95);         this.listBox1.TabIndex = 1;         //          // label1         //          this.label1.AutoSize = true;         this.label1.Location = new System.Drawing.Point(91, 42);         this.label1.Name = "label1";         this.label1.Size = new System.Drawing.Size(35, 13);         this.label1.TabIndex = 2;         this.label1.Text = "label1";         //          // MYControl         //          this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);         this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;         this.Controls.Add(this.label1);         this.Controls.Add(this.listBox1);         this.Controls.Add(this.textBox1);         this.Name = "MYControl";         this.Size = new System.Drawing.Size(135, 214);         this.ResumeLayout(false);         this.PerformLayout();      }      #endregion           private System.Windows.Forms.Label label1; } 

MyControlBase contains the definition for the ListBox and TextBox. Now when I try to view this control in the Form Designer it gives me these errors:

The variable ‘listBox1’ is either undeclared or was never assigned.

The variable ‘textBox1’ is either undeclared or was never assigned.

This is obviously wrong as they are defined in MyControlBase with public access. Is there any way to massage Form Designer into allowing me to visually edit my control?

  • 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. 2026-05-10T21:38:36+00:00Added an answer on May 10, 2026 at 9:38 pm

    I think you’ll have to use base.listBox1 and base.textBox1. They are defined in MyControlBase which is the base class, not the child class where you need to use the this keyword.

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

Sidebar

Ask A Question

Stats

  • Questions 118k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Using jQuery Selectors, you can target your element by a… May 11, 2026 at 11:40 pm
  • Editorial Team
    Editorial Team added an answer NSString and CFString support reorderable/positional arguments. NSString *string = [NSString… May 11, 2026 at 11:40 pm
  • Editorial Team
    Editorial Team added an answer I just read this Action Script is a dynamic language,… May 11, 2026 at 11:40 pm

Related Questions

I have a control (derived from System.Windows.Forms.Control) which needs to be transparent in some
I have a Parent Form that holds a HUD with First Name, Last Name,
I have created a custom WPF user control which is intended to be used
Ok I have an issue. I have a Linux web server (RHEL 4 with

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.