Board index » delphi » Setting ActivePage During RunTime In PageControl

Setting ActivePage During RunTime In PageControl

Hi,
   I hope this question isn't silly, but I just don't know how to go about
doing it. How do I set the Active Page for a page control programmatically
during Run Time? Kindly reply, thanks.
 

Re:Setting ActivePage During RunTime In PageControl


Like this:

   PageControl1.ActivePage := TabSheet1;

    - Wyk

Quote
Ong SL <li...@mbox3.singnet.com.sg> wrote in message

news:7k8him$n5o5@forums.borland.com...
Quote
> Hi,
>    I hope this question isn't silly, but I just don't know how to go about
> doing it. How do I set the Active Page for a page control programmatically
> during Run Time? Kindly reply, thanks.

Re:Setting ActivePage During RunTime In PageControl


Quote
In article <7k8him$n...@forums.borland.com>, Ong SL wrote:
> I hope this question isn't silly

No, but it is duplicated. Your question has been answered in the
Objectpascal NG.

Please post each question to just a single newsgroup in order to avoid
duplication of effort by those answering.

 Mike Orriss (TeamB)
 (Unless stated otherwise, my replies relate to Delphi 4.03)
 (Unsolicited e-mail replies will most likely be ignored)

Re:Setting ActivePage During RunTime In PageControl


Hi,
   Thank you for the advice. I'm sorry for the trouble I'd caused. But I
must admit that I'm rather new with both Delphi and newsgroups, so I hope
that I'm forgiven. 8-)

Quote
Mike Orriss (TeamB) wrote in message ...
>In article <7k8him$n...@forums.borland.com>, Ong SL wrote:
>> I hope this question isn't silly
>No, but it is duplicated. Your question has been answered in the
>Objectpascal NG.
>Please post each question to just a single newsgroup in order to avoid

duplication of effort by those answering.
Quote
> Mike Orriss (TeamB)

Re:Setting ActivePage During RunTime In PageControl


Quote
In article <7kb2rk$p9...@forums.borland.com>, Ong SL wrote:
> But I
> must admit that I'm rather new with both Delphi and newsgroups, so I hope
> that I'm forgiven

Of course.

I'm just trying to maximise use of our resources.

There are too many questions to answer them all and some take quite a bit
of time, especially if research is required. It can be quite frustrating to
spend 20 minutes on an answer to then find it already answered elsewhere.

 Mike Orriss (TeamB)
 (Unless stated otherwise, my replies relate to Delphi 4.03)
 (Unsolicited e-mail replies will most likely be ignored)

Re:Setting ActivePage During RunTime In PageControl


Assuming of course the TSTestsheet is a tabsheet on the PageControl1 try

procedure TCadetMainForm.But1Click(Sender: TObject);
begin
     Form2.PageControl1.ActivePage := Form2.TSTestsheet;
     Form2.showmodal;
end;

You need to qualify that the TSTestsheet is part of Form2 and not the current
form.

Quote
Ong SL wrote:

> Hi,
>     I'm still having problems with the PageControl. Let me explain my
> situation. I have a button on a Form1, and when I click it I wanted to set
> the ActivePage of a PageControl1 on Form2 to say, TSTestsheet.
> So this is what I have.

> procedure TCadetMainForm.But1Click(Sender: TObject);
> begin
>      Form2.PageControl1.ActivePage:=TSTestsheet;
>      Form2.showmodal;
> end;

> However, the compiler says that TSTestsheet is an unknown identifier. COuld
> you tell me what's happening?

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
If there is somebody up there could they throw me down a line.  Just a
little helping hand just a little understanding.  Just some answers to the
questions that surround me now.  If there's somebody up there could
they throw me down a line.               (Fish)
--

Re:Setting ActivePage During RunTime In PageControl


Hi,
    I'm still having problems with the PageControl. Let me explain my
situation. I have a button on a Form1, and when I click it I wanted to set
the ActivePage of a PageControl1 on Form2 to say, TSTestsheet.
So this is what I have.

procedure TCadetMainForm.But1Click(Sender: TObject);
begin
     Form2.PageControl1.ActivePage:=TSTestsheet;
     Form2.showmodal;
end;

However, the compiler says that TSTestsheet is an unknown identifier. COuld
you tell me what's happening?

Other Threads