Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / August 2006

Tip: Looking for answers? Try searching our database.

Dock and TopLevel properties not appearing in the designer.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kaine - 07 Jul 2006 12:31 GMT
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; }
>> >        }

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.