Solved

Hiding Properties and Events

Posted on 1998-10-14
1
145 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 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