Solved

Hiding inherited properties from baseclass users

Posted on 1998-08-26
2
258 Views
Last Modified: 2010-04-04
I have a baseclass that has a Event property such as OnRead.  However a sub-class I need to write must disallow the user of this class to not change the OnRead event.  The easiest way would seem to redeclare the event property as private, but that does not seem to work.
0
Comment
Question by:nrobin
[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 Comments
 
LVL 4

Accepted Solution

by:
d003303 earned 100 total points
ID: 1337808
You can only move properties/methods of an object into a more public area, but not backwards. Otherwise, the whole object model would not work.
To make the OnRead event working like you want, override the property like

  property OnRead: TNotifyEvent read FOnRead;

to make it read-only. Even if it is published it is not visible in object inspector anymore, and you cannot change its value.

Slash/d003303
0
 
LVL 1

Author Comment

by:nrobin
ID: 1337809
Thanks Slash - completely forgotten you could do that!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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: …

691 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