How can I hide a property from going into the form designer file?

Posted by user460334 on Stack Overflow See other posts from Stack Overflow or by user460334
Published on 2010-12-17T05:13:09Z Indexed on 2011/01/05 16:54 UTC
Read the original article Hit count: 166

I am working in VB.NET 2010 Framework 2.0.

I don't want to allow some properties from going into form's designer file but the those properties will present on the form(property grid). The behavior of these properties will be same always.

I used the following code:

<DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)>
Public Property GradientBegin() As Color = Color.Red 

But the problem I am facing is that -> on the property grid after changing the "GradientBegin" color to other than RED and compiling the program, it is replacing the new changed value to RED again. So I am not able to change the color actually.

How can I achieve this?

Thanks for any reply in advance.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about vb.net