Solved

Hiding inherited properties from baseclass users

Posted on 1998-08-26
2
257 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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Reconfigure Delphi Install? 2 65
Delphi: Connect to running MS Outlook 4 165
FMX and jaudiotracker playing memory stream 29 98
Delphi and Access based Enumeration 9 78
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 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