|
-
Jul 7th, 2006, 04:17 PM
#1
Thread Starter
PowerPoster
[Resolved] [2.0] Hide inherited members in PropertyGrid
I'm working on a user control for a project of mine, and I would like to save a lot of time and effort by letting the user edit the properties of another user control via the PropertyGrid. However, I'd like to just show the members that I have created, not the ones inherited from Control. Is there an easy way to accomplish this? I looked at the AttributeCollection (or whatever), but it did not seem to contain the information I wanted.
Last edited by sunburnt; Jul 9th, 2006 at 04:34 PM.
Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
-
Jul 7th, 2006, 04:56 PM
#2
Re: [2.0] Hide inherited members in PropertyGrid
I have the same problem with my panel user control in vb.net. What was suggested was to create a filtering class inbetween the user control and any properties and collection properties etc.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 7th, 2006, 05:51 PM
#3
Re: [2.0] Hide inherited members in PropertyGrid
You would create a corresponding pass-through member in your class and apply the Browsable attribute as false:
Code:
[Browsable(false)]
public new SomeType SomeProperty
{
get { return base.SomeProperty; }
set { base.Someproperty = value; }
}
-
Jul 9th, 2006, 04:33 PM
#4
Thread Starter
PowerPoster
Re: [2.0] Hide inherited members in PropertyGrid
Both these suggestions sound good. Someone else mentioned that I should implement ICustomTypeDescriptor and implement the GetProperties() / GetDefaultProperty() / GetEvents() / GetDefaultEvent() functions.
Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
-
Jul 9th, 2006, 05:51 PM
#5
Re: [Resolved] [2.0] Hide inherited members in PropertyGrid
Its coming back to me now. I wanted to use a custom property that was the same name as a default built in one. so I had to create the intermediate filtering class. You could do like John posted with the Browseable (false) as its an easy solution and should be all you need.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|