Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Hiding Properties and Events

Posted on 1998-10-14
1
Medium Priority
?
160 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 400 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

773 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