Custom Control Properties

  • Thread starter Thread starter Rick Mogstad
  • Start date Start date
R

Rick Mogstad

I have a control that I need to remove some properties from. I have marked
them obsolete so that the rest of the dev team can continue to work,
however, if they delete them, it automatically regenerates them in the auto
generated code. Is there a way to mark them so they dont re-generate those
properties?

I dont want to just remove them, because I dont want everyone to have
compile errors until they are fixed.

Thanks,

Rick
 
Rick Mogstad said:
I have a control that I need to remove some properties from. I have
marked them obsolete so that the rest of the dev team can continue
to work, however, if they delete them, it automatically regenerates
them in the auto generated code. Is there a way to mark them so
they dont re-generate those properties?

I dont want to just remove them, because I dont want everyone to
have compile errors until they are fixed.


Apply the System.ComponentModel.DesignerSerializationVisibilityAttribute to
the property.


Armin
 
If you use the Browsable(False) attribute on the control, it will no longer
show up in the properties window, and the designer won't generate code for it.
 
Scott Swigart said:
If you use the Browsable(False) attribute on the control, it will no
longer
show up in the properties window, and the designer won't generate code for
it.

That's what I thought as well - until I found it didn't work and had my
Developers complaining that 20-odd miscreant properties were
reappearing in their code!

Even applying the DefaultValue Attribute didn't quite cut it - properties
that returned Enum's /still/ got persisted into code.

The DesignerSerialisationVisibility Attribute is the /only/ way I've found
to remove them that works reliably.

Regards,
Phill W.
 
Back
Top