 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
DaveD Guest
|
Posted: Thu May 25, 2006 8:14 pm Post subject: TCustomEdit::OnChange not firing as expected |
|
|
I have an UpDown control associated with an edit box, on a form that is not visible. I intialize them by setting
UpDown->Position to a value. I want the Edit box to get updated at this time, but the expected edit box Change event doesn't occur until I show the form. I don't understand why it works this way. |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu May 25, 2006 8:14 pm Post subject: Re: TCustomEdit::OnChange not firing as expected |
|
|
"DaveD" <ddebenedetto (AT) telular (DOT) com> wrote in message
news:447609b9$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I have an UpDown control associated with an edit box, on a form that
is not visible. I intialize them by setting UpDown->Position to a value. I
want the Edit box to get updated at this time
|
It will be.
| Quote: | the expected edit box Change event doesn't occur until I show the form.
I don't understand why it works this way.
|
That is how it is supposed to work. The OnChange event is triggered in
response to EN_CHANGE notifications, which are not sent for hidden controls.
Changing the TUpDown while the TEdit is hidden will not trigger the TEdit's
OnChange event. If you need the OnChange event to be triggered, you will
have to trigger it manually in your code, ie:
UpDown1->Position = whatever;
Edit1Change(Edit1);
Gambit |
|
| Back to top |
|
 |
DaveD Guest
|
Posted: Fri May 26, 2006 12:42 am Post subject: Re: TCustomEdit::OnChange not firing as expected |
|
|
| Quote: | If you need the OnChange event to be triggered, you will
have to trigger it manually
|
Thank you. I added the manual trigger as you suggested, but OnChange still fires again when the form is shown. Is there a way to prevent this?
BTW, this only happens the first time the form is shown; the form is created at program startup and is never destroyed. |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri May 26, 2006 12:55 am Post subject: Re: TCustomEdit::OnChange not firing as expected |
|
|
"DaveD" <ddebenedetto (AT) telular (DOT) com> wrote in message
news:447616ac$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I added the manual trigger as you suggested, but OnChange still fires
again when the form is shown. Is there a way to prevent this?
|
Nope. You will just have to set a flag somewhere so you know that you
triggered it manually, and then ignore the event if the flag is set.
Gambit |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|