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 2006

Tip: Looking for answers? Try searching our database.

how do I dynamically enable/disable a property?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Xafier - 07 Apr 2006 11:02 GMT
Hi

I've got a control that has a property in the Behavior section, it has
3 options, depending upon this property's selection I want to hide or
show other property's, because the user won't need access to them
unless they've selected the appropriate selection on the property in
Behavior.

Is there any easy way to do this? I will most likely need to the same
thing on quite a few controls so re-useability would be nice.

thanks,

Kris Wragg
Vijay - 25 Apr 2006 03:03 GMT
I am not sure how this would be done with exact syntax... but I believe you
have to alter the attribute browseable to false for a property

[Browseable(false)]
public property MyTest
{
   // get and set constructors..
}

Now if you want to do this dynamically in code.. I believe using reflection
is the only way.... to do it... check below link

http://msdn2.microsoft.com/en-us/library/system.componentmodel.browsableattribut
e.browsable(VS.80).aspx


VJ

> Hi
>
[quoted text clipped - 10 lines]
>
> Kris Wragg
jokiz - 10 May 2006 10:19 GMT
you'd have to implement ICustomTypeDescriptor and alter the returned
propertyinfo collection on the GetProperties method
jokiz - 10 May 2006 10:27 GMT
you'd have to implement ICustomTypeDescriptor and alter the returned
propertyinfo collection on the GetProperties method

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.