 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Mike Collins Guest
|
Posted: Sun Jun 26, 2005 9:56 pm Post subject: TPageControl & OnChange problems |
|
|
Hi all, having a bit of a problem with a TPageControl. Basically I have a
PageControl with 8 tabsheets on it and an OnChange event coded, for the
PageControl, that make some display alterations depending on which tab is
active. When the form is first created I set the ActivePage to the first
tabsheet (which it isn't at design time) using the code
pgcWizard->ActivePage = tbsIntro; where tbsIntro is the first tabsheet.
However the OnChange event doesn't seem to fire, the first page is displayed
but the OnChange code isn't executed. I've tried placing the code in the
FormShow but still no joy. Once displayed, if I click on the various tabs
the code gets executed but not is I set the ActivePage myself
Any ideas?
|
|
| Back to top |
|
 |
salamander1965 Guest
|
Posted: Mon Jun 27, 2005 1:28 am Post subject: Re: TPageControl & OnChange problems |
|
|
Mike Collins wrote:
| Quote: | When the form is first created I set the ActivePage to the first
tabsheet (which it isn't at design time) using the code
pgcWizard->ActivePage = tbsIntro; where tbsIntro is the first tabsheet.
|
Any reason you can't make tbsIntro the active page at design time?
| Quote: | However the OnChange event doesn't seem to fire, the first page is displayed
but the OnChange code isn't executed.
|
I think that some events aren't necessarily triggered when you might
expect them to be -- eg, programmatic vs. user actions don't always
result in the same events being triggered.
| Quote: | Once displayed, if I click on the various tabs
the code gets executed but not is I set the ActivePage myself
|
If you can set tbsIntro at design time, you should be OK. I'm assuming
that if you switch to another tab (triggering OnChange) and then switch
back to tbsIntro, you get the OnChange as you should.
-- S.
|
|
| Back to top |
|
 |
Kent Guest
|
Posted: Mon Jun 27, 2005 2:47 am Post subject: Re: TPageControl & OnChange problems |
|
|
Mike,
Try forcing the OnChange event with a direct call in
FormShow or another more suitable location like so:
PageControl1Change(NULL);
Kent
|
|
| Back to top |
|
 |
Mike Collins Guest
|
Posted: Mon Jun 27, 2005 9:15 am Post subject: Re: TPageControl & OnChange problems |
|
|
Yeh, thats how I'm doing it at present, but it seems like a bit of a hack.
Obviously I could set the tabsheet at design time, but it doesn't follow
with my design (I'm basically creating a wizard so you never see the tabs
anyway). Would be helpful if the help files provided a bit more
information, like this event is only fired in responce to a user clicking on
a tab, and will not be fired if the tabsheet is activated programmablly :-)
"Kent" <kentav (AT) accessus (DOT) net> wrote
| Quote: | Mike,
Try forcing the OnChange event with a direct call in
FormShow or another more suitable location like so:
PageControl1Change(NULL);
Kent
|
|
|
| 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
|
|