473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Hiding Inherited properties

Hi,

I've develpped a reusable UserControl. The only headache it's giving me is
how to hide the inherited properties such as AutoScroll, DockPadding, etc...
wich could cause some visual Anoyances on my control.I've tried

<System.ComponentModel.Browsable(False),
System.ComponentModel.EditorBrowsable(System.Compo nentModel.EditorBrowsableS
tate.Never),
System.ComponentModel.DesignerSerializationVisibil ity(System.ComponentModel.
DesignerSerializationVisibility.Hidden)>

This way the properties are not visible at the property grid, but they are
visible when writting the code (Intelisense). Is there another way to get
rid of them?

Thank you in advance
Nov 21 '05 #1
2 1303
Juan,

This is often asked, there has not been a Yes answer with description yet.

You can see it in the standard classes also. If you set the
textbox.backcolor, you can set it, however because of the fact that the
textbox has no background, it does nothing. It is not set the propertygrid,
however you can set it in code as often as you want.

I hope this helps,

Cor
Nov 21 '05 #2
"Juan Pedro Gonzalez" <th******@terra.es> wrote in message
news:Oc*************@TK2MSFTNGP14.phx.gbl...
The only headache it's giving me is how to hide the inherited
properties .. . . This way the properties are not visible at the property grid, but
they are visible when writting the code (Intelisense). .. . . Is there another way to get rid of them?


No. That's one of the basic tenets of Inheritance.

However, you might be able to "side-step" this by declaring
an Interface for your control and creating "duplicate" variables
for each actual control that are defined as the Interface Type,
something like

Interface ITinyTextBox
Property Enabled() As String
Property Text() As String
End Interface

Class myTextBox
Inherits Forms.TextBox
Implements ITinyTextBox
. . .

Then, in your form, the Forms Designer will write

Friend WithEvents txtThing As myTextBox
. . .
txtThing = New myTextBox

Then you can add

Private txtSimpleThing as ITinyTextBox _
= DirectCast( txtThing, ITinyTextBox )

Then use txtSimpleThing in place of txtThing:

Me.txtSimpleThing.Text = ...

And all you'll see are the things defined in the Interface.

HTH,
Phill W.
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: thechaosengine | last post by:
Hi all, Is there a way to hide a member in a subclass that has been inherited from a base class? Lets leave aside any issues regarding whether its a good idea for a moment. Here's an example...
4
by: A Ratcliffe | last post by:
Back again... I have some classes that inherit from each other, as an example... Point (abstract base class) Point3 (for 3D points), derived from Point Point4 (adds a homogenous...
4
by: Dan | last post by:
I have a need to make a set of classes that all share the same public methods, some implementation and some data. So, I made an abstract base (BaseClass) with an interface (IBaseClass) and a...
7
by: Dennis | last post by:
I have a class named myclass that inheirits from "baseclass". There is a property of "baseclass" that I don't want exposed in the IDE. The MSDN documentation says" "A derived type can hide an...
1
by: Juan Pedro Gonzalez | last post by:
Hi, I've develpped a reusable UserControl. The only headache it's giving me is how to hide the inherited properties such as AutoScroll, DockPadding, etc... wich could cause some visual Anoyances...
2
by: Steven Nagy | last post by:
Hi all, How would I go about hiding an inherited property? In particular, I want to hide the 'BackColor' property of the UserControl class. I will then implement my own back color related...
5
by: PIEBALD | last post by:
I was trying to break some polymorphism, expecting it not to work, but I'm a curious sort. I was seeing what happens when a derived class tries to hide an inherited method with a private new...
10
by: Smokey Grindle | last post by:
i want to inherit the list view class, but in the inherited class, hide the Header style property and the view property (basically its a detailed list with always clickable headers) how do I keep...
14
by: Dom | last post by:
Hi all I'm developing a control, and I need to hide some properties to the user. For example, suppose I need Text property to be completely inacessible (from a Form/Code that is into another...
9
by: Torben Laursen | last post by:
Hi I have a class that I use in Excel to define some custom functions. The problem that I have is that the class also has some building functions that for some reason is there: ToString...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.