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 / May 2004

Tip: Looking for answers? Try searching our database.

Making property not visible in Properties at design time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marina - 21 May 2004 18:48 GMT
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
Jeff Gaines - 21 May 2004 19:51 GMT
>Hi,
>I have a control with a property that I do not wish to be visible at design
[quoted text clipped - 7 lines]
>
>Thanks

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");
    }
}

Signature

Jeff Gaines - Damerham Hampshire UK

Floyd Burger - 22 May 2004 00:54 GMT
The BrowsableAttribute is probably what you're looking for.

Signature

Floyd Burger

> Hi,
> I have a control with a property that I do not wish to be visible at design
[quoted text clipped - 7 lines]
>
> Thanks
Marina - 24 May 2004 18:00 GMT
Yes, that was the one. Thanks!

> The BrowsableAttribute is probably what you're looking for.
>
[quoted text clipped - 10 lines]
> >
> > Thanks

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.