I'm a bit confused. You want to hide its reference fom the Properties Editor but you also want to change what it looks like which means to show it.
If you were to hide a property, you would use this attribute:
[Browseable(false)]
But I think you want to show it and make it expandable. Use this "TypeConverter":
[TypeConverter(typeof(ExpandableObjectConverter))]
If you want to make the label shown by the ExpandableObjectConverter different, subclass it like this:
public class MyTypeConverter : ExpandableObjectConverter
{
public override object ConvertTo(ITypeDescriptorContext pContext,
CultureInfo pCulture, object pValue, Type pDestinationType)
{
if (pDestinationType == typeof(string))
{
string vText = "";
// define the text to show here. The pValue object is the actual data so you can use it to determine the text if you like.
return vText;
}
return base.ConvertTo(pContext, pCulture, pValue, pDestinationType);
}
}
I think the .net documentation covers these ideas pretty well but if you are really trying to learn custom controls, I recommend the book "Developing ASP.NET Server Controls and Components" from Microsoft Press.
--- Peter Blum
Creator of Professional Validation And More Suite, Peter's Date Package, and Peter's Polling Package
www.PeterBlum.com