Solved

Hiding Properties and Events

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

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month4 days, 8 hours left to enroll

636 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