Board index » cppbuilder » TabSheet Problem (Getting to the bottom of things)

TabSheet Problem (Getting to the bottom of things)


2005-04-27 10:50:23 PM
cppbuilder71
I was incorrect in saying that,
PageControl1->ActivePage = TabSheet1;
does not work. It does work, if you place a button on say, TabSheet2, and
once the user, clicks on it,
then you place PageControl1->ActivePage = TabSheet1; code, it will change to
TabSheet1. Then why
didn't this work out for me in my situation?
Well, here is probably why!!
On an event OnShow of TabSheet2, I have the following:
if (OpenDialog1->Execute() == true)
{
......... some code
}
else
PageControl1->ActivePage = TabSheet1;
well, I believe that since, I am still on the OnShow event the ActivePage is
still TabSheet1, and not until the OnShow event is finished, will the
PageControl1...... piece of code work.
But how can I get around this?
Thank you,
Neil P.
 
 

Re:TabSheet Problem (Getting to the bottom of things)

Neil P. wrote:
Quote
I was incorrect in saying that,

PageControl1->ActivePage = TabSheet1;
This is the third thread you start for the same problem. You better
could have stayed with the first one.
Quote
Well, here is probably why!!
That could well be the cause. I did not check that though. In such case
a solution is to start a TTimer.
if ( OpenDialog1->Execute() )
{
// ..
}
else
Timer1->Enabled = true;
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
Timer1->Enabled = false;
PageControl1->ActivePage = TabSheet1;
}
Hans.