We have found that the Dock and TopLevel properties do not appear in the .NET
2005 C# forms designer so we added the code below to our base forms, but
still the properties would not appear for our derived forms. Once we changed
the names of the properties and removed the override keywords the properties
appeared under new names and worked as expected, but we would like them to
work with their proper names. Is there something we are missing from our
attributes that needs to be added?
[Description("Gets/sets the docking style for the form."),
Category("CasinoLink"),
Bindable(BindableSupport.No), DesignOnly(false),
DefaultValue(DockStyle.Fill)]
public override DockStyle Dock
{
get
{
return base.Dock;
}
set
{
base.Dock = value;
}
}
[Description("Gets/sets the indicator that allows the form to be
displayed as a top level form."), Category("CasinoLink"),
Bindable(BindableSupport.No), DesignOnly(false), DefaultValue(false)]
public new bool TopLevel
{
get { return (base.TopLevel); }
set { base.TopLevel = value; }
}
Dave Sexton - 08 Jul 2006 02:35 GMT
Hi Kaine,
[Browsable(true)]
public override DockStyle Dock {}
HTH
> We have found that the Dock and TopLevel properties do not appear in the
> .NET
[quoted text clipped - 32 lines]
> set { base.TopLevel = value; }
> }
Kaine - 13 Aug 2006 19:04 GMT
Sorry for the lateness in the reply. We tried this originally and found that
the property still wouldn't appear in the designer. The only way we managed
to successfully do this was to use a wrapper property which we called
DockingStyle.
> Hi Kaine,
>
[quoted text clipped - 39 lines]
> > set { base.TopLevel = value; }
> > }
Dave Sexton - 13 Aug 2006 20:42 GMT
Hi Kaine,
It's a strange thing. I tried using the "new" keyword as well but that didn't do any good either.
However, the DisplayNameAttribute worked fine for me, but it requires a new property. Here's an example:
[DisplayName("Dock")]
public virtual DockStyle DockStyle
{
get { return base.Dock; }
set { base.Dock = value; }
}
// seal the Dock property so that it cannot be overridden by a derived class
public sealed override DockStyle Dock
{
get { return base.Dock; }
set { base.Dock = value; }
}

Signature
Dave Sexton
> Sorry for the lateness in the reply. We tried this originally and found that
> the property still wouldn't appear in the designer. The only way we managed
[quoted text clipped - 44 lines]
>> > set { base.TopLevel = value; }
>> > }