Solved

event disabling

Posted on 1997-06-19
1
149 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 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

20 Experts available now in Live!

Get 1:1 Help Now