Board index » cppbuilder » two buttons, one action

two buttons, one action


2004-03-06 07:30:02 AM
cppbuilder83
Hi,
Say I have an action, Act1, that I assign to two TButtons Btn1 and Btn2,
Is there a way, when inside Act1Execute(Sender) to see if the action was
triggered by Btn1 or Btn2?
The sender, in Act1Execute seems to be the action itself?
I want to have a sligtly different execute behaviour for the two buttons,
but I don't want to duplicate code..
regards
/totte
 
 

Re:two buttons, one action

"Totte Karlsson" < XXXX@XXXXX.COM >wrote in message
Quote
Is there a way, when inside Act1Execute(Sender) to see
if the action was triggered by Btn1 or Btn2?
No.
Quote
The sender, in Act1Execute seems to be the action itself?
Correct.
Gambit
 

Re:two buttons, one action

You could check the ActiveControl property of your form.
Palle
"Totte Karlsson" < XXXX@XXXXX.COM >skrev i en meddelelse
Quote
Hi,
Say I have an action, Act1, that I assign to two TButtons Btn1 and Btn2,

Is there a way, when inside Act1Execute(Sender) to see if the action was
triggered by Btn1 or Btn2?
The sender, in Act1Execute seems to be the action itself?

I want to have a sligtly different execute behaviour for the two buttons,
but I don't want to duplicate code..
regards
/totte




 

{smallsort}