Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Detect component resize

edited October 2007 in End User
Hi

I am using Delphi 7, RB Pro 10.05

Is it possible to detect when the user resizes a component in the designer?
I need to change the size of some components in response to a change in size
in others. I am currently using TppDesigner.OnSelectionChanged to compare
the current size of the components I'm interested in against stored values
for these components. This is not ideal, as this relies on the user first
selecting something else before the change is noticable.

Thanks,
Steve Spralja

Comments

  • edited October 2007

    I was able to create the following downloadable example. (In testing it, I
    noticed that the MoveBounds/ResizeBounds notifcation fires a bit too often,
    something we look at optimizing going forward.)

    www.digital-metaphors.com/tips/ObservePropertyChange.zip


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2007
    Thanks very much, this is just what I needed.

    One minor problem: the dimensions of the component that was moved/resized
    are not updated by the time the AfterPropertyChange event is called. I got
    around this by using a timer, but if there's a more elegant method I'd
    definitely be interested.

    Thanks again,

    Steve Spralja



This discussion has been closed.