Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActivePage and TTabSheets

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I found this in the delphi help;

Code:
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  if (Sender is TComboBox) then
    with (Sender as TComboBox) do
      PageControl1.ActivePage := TTabSheet(Items.Objects[ItemIndex]);

end;

I needs to set the ActivePage to a specific tabsheet, how do I replace the (Items.Objects[ItemIndex]) with the name of the tabsheet I want active?

Thanks!


Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!
 
I figured it out!

I justed need to put the Form.TabsheetName

Thanks anyway!
Leslie

 
Failing that, you can set the index of the page.

Pagecontrol1.ActivePageIndex := 0; //First page
Pagecontrol1.ActivePageIndex := 1; //Second page and so on

Handy when, like in my application, you dont actually know what the tabsheets will be called at design time.


When your feeling down and your resistance is low, light another cigarette and let yourself go [rockband]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top