How to access properties of component calling the function? |
|
Re: How to access properties of component calling the functi |
|
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> Erik wrote:
>
> > Is there a way to access the properties of the function or component
> > that in calling the current function?
>
> The event's Sender parameter points to the component instance that is triggering
> the event. Simply type-cast that pointer to the appropriate type, eg:
>
> {code}
> void __fastcall TForm1::AdvSmoothButton1MouseEnter(TObject *Sender)
> {
> TAdvSmoothButton *btn = static_cast(Sender);
> btn->Appearance->GlowPercentage = btn->Appearance->GlowPercentage + 15;
> }
> {code}
>
> --
> Remy Lebeau (TeamB)
Thanks a lot. I knew there had to be a simple solution, I searched hours trying to find it with no avail. I had to tweak it to static_cast(Sender); Other then that its perfect! Thanks again.
|
Re: How to access properties of component calling the functi |
|