Solved

Hiding inherited properties from baseclass users

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
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, f…

910 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

18 Experts available now in Live!

Get 1:1 Help Now