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

  • Home
  • SEARCH
  • 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 626735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:27:03+00:00 2026-05-13T19:27:03+00:00

I have an Extender component of IExtenderProvider which extends a TextBox to have a

  • 0

I have an Extender component of IExtenderProvider which extends a TextBox to have a “selected color”. The default value for this color is “highlight”. The user can change the “default selected color” in the Extender’s property grid. If no extended TextBox has “selected color” defined, it will use the specified “default deleted color” value.

If the programmer has changed a TextBox’s “selected color”, I want to provide the “reset” command in the property grid that resets the “selected color” to the “default selected color”, as define in the Extender component.

How do I add the “reset” command to the extended control’s property grid value then “reset” that extended property to the default value provided by the extender?

I want to allow the user to right-click on the extended property and choose Reset to restore the property to its default value as defined in the extender.

(See Defining Default Values with the ShouldSerialize and Reset Methods at http://msdn.microsoft.com/en-us/library/53b8022e.aspx)
Obviously, this is not going to work.

Public Sub ResetGetMyProperty()
    MyProperty = "Hello World!"
End Sub

And I cannnot use the following because this is for the “reset” on the Extender’s property.

Public Sub ResetMyProperty()
    MyProperty = "Hello World!"
End Sub

I cannot use DefaultValue, as shown below, because it requires a constant, which is not the case because the programmer can change the default value.

<DefaultValue("Hello World!")> _
Public Sub GetMyProperty(control As Control) As String
    Return _extendees(control).MyProperty
End Sub

I need something like <DefaultValue(Me.Property)> because Me.Property is the value specified by the programmer through the property grid. (Which I cannot do, because Me.Property is not a constant.)

[clarification]
The extender itself has properties. These are the default values for any extended control. If a programmer does not specify an “override” value for a specific extended control, then the default value will be use. I, as the author of the extender, default to a specific value, say “highlight”, but you, the user of my extender, want to default to “red”, you will have to change the extender’s property. Now any extended controls, which did not define this extended property will use “red”. Yet, any control that have specified a value…cannot “reset” to this “red”. DefaultValue doesn’t apply. (Currently, the only way to set the default is to delete the code from the designer.)

Any suggestions?

Note that I do not use Color in the code fragments above because it clutters up what I am trying to illustrate.

  • 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-13T19:27:04+00:00Added an answer on May 13, 2026 at 7:27 pm

    The reset method signature for extended property is:

    Public Sub ResetMyProperty(control As Control)
        MyProperty = "Hello World!"
    End Sub
    

    Do similar thing to ShouldSerializeValue method by adding a control parameter.

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

Sidebar

Related Questions

I have a check box, RequiredFieldValidator and textbox that have editmask extender I want
I have a modal popup extender which is triggered by gridview onRowCommand. The gridview
i have a textbox associated with a calendar extender and a masked edit extender
I have a proxied method in a MongoRepository extender class like this: public interface
I have a text box which has a Ajax calendar extender attached. You click
I have two dropdownlists, and two txtboxes which have a calendar popup extender, whenever
I have update panel that content check box, textbox, 3 DropDownList with CascadingDropDown extender.
I have a simple extender component that draws 3D borders around any Control. In
I have a MyFrame class which extends JFrame . I added components(Controls i.e buttons)
I have a custom component that extends a panel. The panel has a top

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.