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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:22:41+00:00 2026-05-23T09:22:41+00:00

I have the wierdest thing going on in my solution. I have a button,

  • 0

I have the wierdest thing going on in my solution.
I have a button, which I customly made. It inherits UserControl, and its text is represented as a Label inside that control.

Naturally, I wanted the button’s text to be overridden to set the Label’s text:

Either,

    /// <summary>
    /// Gets or sets the text that appears in the button
    /// </summary>
    [Category("Appearance"), Description("Gets or sets the text on the button.")]
    [Browsable(true)]
    public override string Text
    {
        get
        {
            return base.Text;
        }
        set
        {
            base.Text = value;
            labelButtonText.Text = value;
        }
    }

Or

    /// <summary>
    /// Gets or sets the text that appears in the button
    /// </summary>
    [Category("Appearance"), Description("Gets or sets the text on the button.")]
    [Browsable(true)]
    public override string Text
    {
        get
        {
            return labelButtonText.Text ;
        }
        set
        {
            labelButtonText.Text = value;
        }
    }

Regardless of the method, when I use that button in another UserControls/Forms,
the text I explicitly put inside in the designer dissappears after compilation.

I checked in the “Button.designer.cs” file, and there is no assignment of the text to null nor empty for neither the UserControl nor the Label.

EDIT: Moreover, when I set the Text property in the designer, it does not set in the *.designer.cs file.

Thanks in advance.

  • 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-23T09:22:41+00:00Added an answer on May 23, 2026 at 9:22 am

    Yes, this is by design. The UserControl.Text property looks like this:

    [Browsable(false)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Bindable(false)]
    public override string Text
    {
        get
        {
            return base.Text;
        }
        set
        {
            base.Text = value;
        }
    }
    

    You took care of the [Browsable] attribute but not the [DesignerSerializationVisibility]. Hidden is what makes the text disappear. Fix it by undo-ing all of the attributes:

        [Browsable(true)]
        [EditorBrowsable(EditorBrowsableState.Always)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Bindable(true)]
        public override string Text {
            // etc..
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The wierdest thing. I have a function which calls: var clicked_el = event.target.id; This
Internet Explorer 8 is doing the weirdest thing: I have a div with text,
I have placed the facebook like button on a website, and the weirdest thing
Have you guys had any experiences (positive or negative) by placing your source code/solution
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have a < div > in my aspx page which has some notification
jquery UI date picker puts a text on top of a button instead of
I have the weirdest thing happening on my site. My PHP script is outputting
Ok this is the weirdest thing I have seen in a while... I am
I have a weirdest thing, in this peace of code a browser adds tags

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.