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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:09:44+00:00 2026-06-02T07:09:44+00:00

I have a user control that inherits from UserControl. It’s a button so I’m

  • 0

I have a user control that inherits from UserControl. It’s a button so I’m trying to make the text in the button, change-able by using the Text property like the real buttons, instead of naming my own like _Text. I have the following code but it doesn’t work (ie it doesn’t show up in the Property Window). The name of the label is ContentPresenter

public override string Text
{
    get
    {
        return ContentPresenter.Text;
    }
    set
    {
        ContentPresenter.Text = value;
    }
}
  • 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-06-02T07:09:45+00:00Added an answer on June 2, 2026 at 7:09 am

    UserControl goes to significant effort to hide the Text property. From the metadata:

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

    You can make it visible by overriding those attributes in your code:

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [EditorBrowsable(EditorBrowsableState.Always)]
        [Bindable(true)]
        public override string Text 
        { 
            get { return ContentPresenter.Text; } 
            set { ContentPresenter.Text = value; } 
        } 
    

    I’m not promising that’s enough to make it work, but it probably is.

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

Sidebar

Related Questions

I have a custom control that inherits from UserControl , and I can't get
Say I have a control that inherits from UserControl (hence one of its super
I have a user control that inherits from the ListBox class and displays a
I have a selfcreated usercontrol that inherits from canvas. Now it is nessesary that
I have created a custom server control that inherits from CompositeControl. In the CreateChildControls
I have user control that inherits a base control class and these user controls
i have a customer control that inherit from the UserControl class and i have
I have a masterpage that contains a user control. The usercontrol uses callbacks for
I have an custom control that extend System.Web.UI.UserControl. Is it possible to inherit user
I have an asp.net usercontrol (ascx) that inherits from an abstract class (that inherits

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.