Solved

Hiding inherited properties from baseclass users

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 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