Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Hiding Properties and Events

Posted on 1998-10-14
1
Medium Priority
?
156 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

715 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