Solved

event disabling

Posted on 1997-06-19
1
165 Views
Last Modified: 2010-04-04
I'm writing my event handlers etc. in the main form module that Delphi generated for me.  Is there an easy way to switch event transmission off and on?  I want to be able to change screen appearance by assigning into component properties *without* triggering "OnChange" events.
0
Comment
Question by:nobbyclark
[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:
icampbe1 earned 100 total points
ID: 1337251
Yes, Subclass the components in question (create a descendant class) and create a new property in that class called DisableEvent (for example).  Supply your own OnChange handler for the origianl component (the ancestor) instead of the one that was plugged in.  Set your new property to TRUE when 'you' want to silently set the other properties.  If it isn't set to true, then you call the original event handler.

It would be nice if all components had a virtual procedure called change that you could override (like Click) and then generate the event if you want to.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 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