Sagaert,
The fact that the property is not visible doesn't meen it is not going to be
serialized in the code.
There are couple of ways you can prevent this.
1. Specify propertie's default value. The designer won't serialize
properties, which has been set to their default values. You can do that
using DefaultValueAttribute attribute or for more complex scenarios you can
provide ShouldSerializeXXXX method
2. Using DesignerSerializationVisibilityAttribute. If you add
DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)
to your property its value won't be serialized into the code regardless of
its value.
--
HTH
Stoitcho Goutsev (100)
"Sagaert Johan" <(E-Mail Removed)> wrote in message
news:u%(E-Mail Removed)...
> hi
>
> In a componenet class i have a property with the attribute
> [System.ComponentModel.Browsable(false)]
>
> public int Vsetting
>
> {
>
> set{....}
>
> get{...}
>
> }
>
>
>
> When i use the component on a form, the property is not visible in de
> peoperties window of the designer (thats ok)
>
> But still the IDE seems to put a line in the form.designer.cs
>
> Vsetting=10;
>
> How can i avoid the IDE inserting that ?
>
>
>
> Johan
>
>
>
>
|