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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:19:55+00:00 2026-05-12T08:19:55+00:00

Maybe the title is not so clear, but this is what I’m experiencing: I

  • 0

Maybe the title is not so clear, but this is what I’m experiencing:

  • I have created a base-form which contains an OK and a Cancel button (which is called BaseOkCancelButtonForm)
    This form also has some properties which look like this:

        [Browsable (true)]
        [Category ("Design")]
        [DesignerSerializationVisibility (DesignerSerializationVisibility.Visible)]
        public string OkButtonText
        {
            get
            {
                return btnOk.Text;
            }
            set
            {
                btnOk.Text = value;
            }
        }
    
       [Browsable (true)]
        [Category ("Design")]
        [DefaultValue (true)]
        [DesignerSerializationVisibility (DesignerSerializationVisibility.Visible)]
        public bool OkButtonVisible
        {
            get
            {
                return btnOk.Visible;
            }
            set
            {
                btnOk.Visible = value;
            }
        }
    
        [Browsable (true)]
        [Category ("Design")]
        [DesignerSerializationVisibility (DesignerSerializationVisibility.Visible)]
        public string CancelButtonText
        {
            get
            {
                return btnCancel.Text;
            }
            set
            {
                btnCancel.Text = value;
            }
        }
    
        [Browsable (true)]
        [Category ("Design")]
        [DefaultValue (true)]
        [DesignerSerializationVisibility (DesignerSerializationVisibility.Visible)]
        public bool CancelButtonVisible
        {
            get
            {
                return btnCancel.Visible;
            }
            set
            {
                btnCancel.Visible = value;
            }
        }
    

Now, this is what is happening:
I create a new form which inherits from my BaseOkCancelButtonForm.

When I modify the CancelButtonText property of my inherited form, and I rebuild the project, everything is going as expected: the Text of the Cancel button remains as the text that i’ve set.
However, when I do the same for the CancelButtonVisible property, things go wrong.
When I set the CancelButtonVisible property to false, and I rebuild the project, then VS.NET resets the value of this property back to true. 😕

For one reason or another, the changed value is not persisted by the designer ?
Is this know behaviour ? Am I doing something wrong ?

  • 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-12T08:19:56+00:00Added an answer on May 12, 2026 at 8:19 am

    Hmm, it seems that this does work when I make the CancelButton on my base form protected.
    But, I do not want to do that.
    Besides, it should not be necessary to do that as well … (And changing the text property of the button does not require the button to be protected, like it should be)…

    Weird.

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

Sidebar

Related Questions

The title of this question is not very clear but I cannot explain what
maybe the title is not very clear, let me elaborate. I have a python
Maybe not the best title I can think of but my problem is this:
Ok, maybe the title isn't the most descriptive thing in the world, but this
Maybe I'm missing something but when I have a form that posts back to
Maybe my title is not the best but here is what I really want.I
Maybe the title is not so clear. Let me clarify what I'm trying to
Maybe the title could be rephrased slightly better but basically I'm wondering how the
I had trouble coming up with a title for this question because I'm not
I have a partial that contains a form: <% form_for :message, :url => {

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.