Solved

Hiding inherited properties from baseclass users

Posted on 1998-08-26
2
253 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
2 Comments
 
LVL 4

Accepted Solution

by:
d003303 earned 100 total points
Comment Utility
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
Comment Utility
Thanks Slash - completely forgotten you could do that!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now