| View previous topic :: View next topic |
| Author |
Message |
Mark Guest
|
Posted: Thu Jun 24, 2004 4:45 pm Post subject: Event handler |
|
|
Hi,
I'm searching for a component by name like this
ComboBox = (TComboBox *)Form->FindComponent(strName);
and then changing its selected item
ComboBox->ItemIndex = 0;
Since the OnChange-handler of ComboBox isn't activated this way I have to
call it myself.
But how do I get the specific event handler?
Mark
|
|
| Back to top |
|
 |
Antonio Felix Guest
|
Posted: Thu Jun 24, 2004 5:02 pm Post subject: Re: Event handler |
|
|
"Mark" <anightinc (AT) gmx (DOT) net> wrote:
| Quote: | Hi,
I'm searching for a component by name like this
ComboBox = (TComboBox *)Form->FindComponent(strName);
and then changing its selected item
ComboBox->ItemIndex = 0;
Since the OnChange-handler of ComboBox isn't activated this way I have to
call it myself.
But how do I get the specific event handler?
Mark
|
Call it like;
OnChangeHandlerName(ComboBox);
ComboBox will be the Sender sent to the Event Handler.
HTH
Antonio
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Jun 24, 2004 5:16 pm Post subject: Re: Event handler |
|
|
"Mark" <anightinc (AT) gmx (DOT) net> wrote
| Quote: | Since the OnChange-handler of ComboBox isn't activated
this way I have to call it myself. But how do I get the specific
event handler?
|
You can call it like this:
if( ComboBox->OnChange )
ComboBox->OnChange(ComboBox);
Gambit
|
|
| Back to top |
|
 |
Mark Guest
|
Posted: Thu Jun 24, 2004 5:25 pm Post subject: Re: Event handler |
|
|
Thanks to both of you!
Mark
|
|
| Back to top |
|
 |
|