473,396 Members | 2,011 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,396 software developers and data experts.

Inherit and control properties.

I've written a control and Inherited a button but I only want to show
only the custom properties that I made. Is there a way to hide the
rest?

Aug 16 '07 #1
4 1311
hi, i think you can override each method and property you don't want to
expose

some like
pirvate overrides sub xyx(byval e as eventargs )
mybase.xyx(e)
end sub

and
private overrides property ...

etc.
I hope this helps.
Greetings, Sergio E.

<sh********@yahoo.comescribió en el mensaje
news:11**********************@d55g2000hsg.googlegr oups.com...
I've written a control and Inherited a button but I only want to show
only the custom properties that I made. Is there a way to hide the
rest?

Aug 17 '07 #2
On Thu, 16 Aug 2007 21:54:42 -0000, "sh********@yahoo.com"
<sh********@yahoo.comwrote:
>I've written a control and Inherited a button but I only want to show
only the custom properties that I made. Is there a way to hide the
rest?
If you don't want any of the button properties, then you should create
your class inherited from UserControl and drop a button into it.
Aug 17 '07 #3
sh********@yahoo.com wrote:
I've written a control and Inherited a button but I only want to show
only the custom properties that I made. Is there a way to hide the
rest?
Define "hide".
If you want to "remove" them so they're not accessible in code, then
strictly; no you can't. That would break the basic principles of
Inheritance.

If you just want to hide them from the Properties window, then you have
to override/shadow each and every one, decorating it with the
Browsable(False) attribute.
To be honest, I wouldn't think this was worth the effort.

If you want to limit the properties/methods you get to play with in the
Intellisense while you're coding, look at creating an Interface that
includes these and declare your Button as the Interface Type, rather
than the actual Class, as in

Interface ICustomButton
Property ButtonText() as String
. . .
End Interface

Class CustomButton
Implements ICustomButton
. . .
Property ButtonText() As String _
Implements ICustomButton.ButtonText
. . .
End Class

Class Form1
Private btnCustom1 as ICustomButton _
= New CustomButton()
. . .

/But/ this almost certainly won't work in the Forms Designer within the
IDE!

HTH,
Phill W.
Aug 17 '07 #4
Shawn,

I never saw any solution for that.

The real controls have as well properties which you see that are inheritted,
some of those don't even work.
AFAIK is one of those the background color from the picturebox.

For the rest read Phil his reply.

Cor
Aug 17 '07 #5

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

Similar topics

7
by: Fabian Neumann | last post by:
Hi! I got a problem with font-family inheritance. Let's say I have CSS definitions like: p { font:normal 10pt Verdana; } strong { font:normal 14pt inherit;
0
by: Prathiraj | last post by:
Hi All, Please let me know the steps one has to follow for successful inheritance of a control. An example would be to inherit an ImageButton server side control with OnClick functionality...
6
by: Mohammad-Reza | last post by:
I wrote a component using class library wizard. In my component i want to in order to RightToLeft property do some works. I can find out if user set this property to Yes or No, But if He/She set it...
1
by: Spurry Moses | last post by:
Hi, I'm converting a project from C++Builder to C# and I just need to copy my class design across. It's looking good so far. To stick with the design I want to inherit from a ComboBox control...
2
by: Sehboo | last post by:
Can somebody please tell me how to inherit a DropDown box in asp.net C# - step by step. I just want to inherit DropDown box and then add few more properties and methods - but I just don't know...
7
by: Frank | last post by:
Hi, a question probably asked before, but I can't find the answers. Base class X, classes A, B and C inherit class X. In class A I do not want to inherit property (or function or method) P1....
5
by: DAVE P | last post by:
i want to extend the progress bar control via inheritance my question is...in the ide how can i expose the inherited control for instance can i ad my inherited control in the tool box or is...
7
by: wagger | last post by:
Hi! I am creating a set of static classes, one class for each "case" I have. The class should do and perform certain things, and the different static classes are doing different things. However,...
2
by: Joe | last post by:
Is it possible to inherit from a UserControl? If I try my user control class is not recognized. Thanks, Joe
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.