Solved

Hiding Properties and Events

Posted on 1998-10-14
1
149 Views
Last Modified: 2010-04-06
If I've derived my component from another component and I don't want the user to be able to view properties or set handlers for events used by the base component, how on earth do I hide them from my new component.

My component is derived from the TClientSocket and I want to remove the Active property (and a few others), and also OnConnecting event (among others).
0
Comment
Question by:Dazza051197
1 Comment
 
LVL 2

Accepted Solution

by:
Thaddy earned 100 total points
ID: 1342841
There is no legal way to 'unpublish' properties en methods that have been published in one of the ancestorclasses.
In this case you should derive from Tcustomsocket instead.
It's good practice to derive from a custom class if its present, because they are there precisely for the reason of visibility.
Here's what to do:
-Derive your class from Tcustomsocket
-Copy sourcecode from necessary members in Tclientsocket to your Tcustomsocket code.
-Make any members you want to be invisible protected, if you want to be able to use them only from the class or its derived classes, or public in case you want to use the members from outside the class or its derivatives.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 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