By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,344 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,344 IT Pros & Developers. It's quick & easy.

Custom Control Properties

P: n/a
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
Mar 23 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Rick Mogstad" <Ri**********@GMail.NOSPAM.com> schrieb
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.DesignerSerializationVisibil ityAttribute to
the property.
Armin

Mar 23 '06 #2

P: n/a
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.

"Rick Mogstad" wrote:
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

Mar 23 '06 #3

P: n/a

"Scott Swigart" <sc***@swigartconsulting.com> wrote in message
news:96**********************************@microsof t.com...
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.
Mar 24 '06 #4

P: n/a
I have Browsable(False) already (And EditorBrowsable too), but it still
shows up.
"Scott Swigart" <sc***@swigartconsulting.com> wrote in message
news:96**********************************@microsof t.com...
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.

"Rick Mogstad" wrote:
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

Mar 24 '06 #5

P: n/a
How about the DesignerSerializationVisibility attribute (set to Hidden)

/claes

"Rick Mogstad" <Ri**********@GMail.NOSPAM.com> wrote in message
news:eH**************@TK2MSFTNGP11.phx.gbl...
I have Browsable(False) already (And EditorBrowsable too), but it still
shows up.
"Scott Swigart" <sc***@swigartconsulting.com> wrote in message
news:96**********************************@microsof t.com...
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.

"Rick Mogstad" wrote:
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


Mar 27 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.