all groups > dotnet windows forms designtime > may 2004 >
You're in the

dotnet windows forms designtime

group:

Making property not visible in Properties at design time



Making property not visible in Properties at design time Marina
5/21/2004 1:48:55 PM
dotnet windows forms designtime: Hi,
I have a control with a property that I do not wish to be visible at design
time. There is a DesignTimeVisible attribute, but that works only on
classes - can't apply it to a property, which is what I really want.

So its ok for the property to be accessed at run time - just don't want it
visible at design time.

Can this be done?

Thanks

Re: Making property not visible in Properties at design time Floyd Burger
5/21/2004 5:54:03 PM
The BrowsableAttribute is probably what you're looking for.

--
Floyd Burger

[quoted text, click to view]

Re: Making property not visible in Properties at design time Jeff Gaines
5/21/2004 7:51:49 PM
On Fri, 21 May 2004 13:48:55 -0400, "Marina"
[quoted text, click to view]

You need to use a designer - I use the following to hide the
BackgroundImage property at design time.

namespace JGControlLib
{
[Designer(typeof(JGMaskedTextBoxDesigner))]
public class JGMaskedTextBox :
System.Windows.Forms.UserControl
{
//.... all the class stuff
}
}

public class JGMaskedTextBoxDesigner : ControlDesigner
{
protected override void
PreFilterProperties(System.Collections.IDictionary properties)
{
properties.Remove("BackgroundImage");
}
}

--
Jeff Gaines - Damerham Hampshire UK
Re: Making property not visible in Properties at design time Marina
5/24/2004 1:00:21 PM
Yes, that was the one. Thanks!

[quoted text, click to view]

AddThis Social Bookmark Button