Question about a New version of visual control

  • Thread starter Thread starter Jack Addington
  • Start date Start date
J

Jack Addington

I have a 3rd party control that I use that I have inherited from and used
throughout my application. There is a new version of the control being
released that fixes a number of issues with the designer in VS. Some of the
properties are not being written correctly to the generated code section so
inherited versions of the control aren't always behaving properly.

I'm a little concerned on what I will have to do when the new control is
released. Will a rebuild just fix everything? Does the designer region get
updated all the time or am I going to have to remove and replace all my
controls? or open each form and save?

thx

jack
 
You may have to experiment with this one, because I don't know for
sure, but here is (at least) what I do know.

Control properties are not persisted by Visual Studio on a simple
rebuild. It is the Designer that persists control properties, and a
rebuild does not fire up the Designer.

Neither are Control properties persisted by the Designer if you don't
change anything about the control. If you just open a form in the
designer and then save it, I don't believe that all Control properties
are guaranteed to be persisted again.

I do believe that if you change anything about a Control in the
Designer... anything at all, the Designer will persist _all_ properties
of the Control back to the source code.

So, if I'm right, removing and re-adding your controls is overkill. All
you have to do is bring up each form in the Designer, and then change
any aspect of a control inherited from your third-party control. (And
then change it back, if necessary.) As soon as you change any property
the Designer should remove all of the configuration source code for
that control and re-write it.

It's easy to test, of course: do it once and then look at the source
code to see if it corrected itself.
 
From my experience there are two possible problems. 1) Any default
properties are not updated to the new default value so if IsTrimText is
true in version 1 and false in version 2, the control IsTrimText
property will remain true when you update to version 2. 2) If a property
is missing in version 2, the code will not compile and all affected
controls are not displayed in the design view. Don't panic, just remove
the property in the code view.

Regards,
Jeff
I'm a little concerned on what I will have to do when the new control is
released. Will a rebuild just fix everything?
 
Back
Top