[2005] Custom Component Property Default
I created a version of the standard TextBox that adds an IsValid property. When I started using this control in my project, I had IsValid initially set to False inside my component. Now, I want to have it initially set to true. I made the changes to the component and recompiled the code. Everywhere I already have this control, it still remembers this default value since it is in the .Designer file.
How do I get this to update when I make a change? Surely, I don't have to manually do this.
Code:
<System.ComponentModel.Browsable(False)> _
Property IsValid() As Boolean
Get
Return _IsValid
End Get
Set(ByVal value As Boolean)
_IsValid = value
End Set
End Property
Re: [2005] Custom Component Property Default
If you are saying that you have already dropped a control, say, on to a form and set it's properties; then, yes you'd have to go back a reset the properties of each control on the form.
Re: [2005] Custom Component Property Default
Ouch. That's what I was affraid of.
Re: [2005] Custom Component Property Default
Did you replace the control on the forms with the new compiled version ? When you drop the new version on your forms it should automatically regenerate new designer code and if your new control has the default as false then thats what will be set.
Re: [2005] Custom Component Property Default
Remember these two things:
1. Each instance of a control that is dropped on the form becomes it's own instance of the class that created it -- once you modify it, it becomes unique.
2. Would you like it if Micorsoft suddenly changed the default backcolor of a button to black and then sent out the new dll and suddenly every project you had ever built had it's buttons turn black?
You wouldn't expect that -- so that's not how it works...Thankfully.