Solved

Hiding a property

Posted on 2004-09-01
3
270 Views
Last Modified: 2010-04-15
Hi everyone ..

I have a control NumericTextBox which is inherited from TextBox. Now, TextBox has a property named .Text which I would like to hide from the programmer.

So if the user adds a NumerictextBox to his form, there should be no option .Text

NumericTextBox myNtb = new NumericTextBox();
myNtb.Font ... works
myNtb.Size ... works
myNtb.Text ... doesn't exist


Is there any way how I can do that ?
0
Comment
Question by:somnatic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 11951711
You can't ... the only thing you could do is override the .Text method ...

There is reason for this though. If you could inherit from a class to remove functionality (i.e. externally visible items) you would break polymorphism.
0
 
LVL 4

Author Comment

by:somnatic
ID: 11951769
ok, already thought so .. only couldn't think of a reason ..

but now that's clear .. makes sense as well :)
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11951805
glad to help.

Cheers,

Greg
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question