TechTricks
Technical answers from the trenches 
 
 
 
 

     
   
Reordering Tabsheets in a PageControl
 
   
 Posted: 11 December 2003
 
   
 
 Applies to: Delphi 4 and later
 
   
 
Audience: Everyone
 
       
   

Question: How do I move (or reorder) tabsheet pages in a page control object?

Answer: Change the tabsheet's PageIndex property to the position matching the new location, as shown in the following walkthrough:

  1. Create a new Delphi application.

  2. Select the Win32 tab in the Component Palette and then place a PageControl object on your default form.

  3. Right-click the page control object and then choose New Page from the shortcut menu.

  4. Repeat Step 3 two more times. When finished, your form should look similar to the following figure:

    Tabsheet3 initially appears as the third tab.
  5. Make sure that Tabsheet3 is the selected object in the Object Inspector.

  6. In the Object Inspector, change the PageIndex property to 1 and notice that the page moves to the new position, as shown in the following figure:

    Tabsheet3 now appears as the second tab.

As with other collection properties in Delphi, PageIndex is a zero-based value. To move your third tabsheet to the second page position, change PageIndex from 2 to 1. If you're doing this while designing your form, remember to select the tabsheet you wish to move before changing PageIndex.

 

       

Top

Feedback About Paradox Delphi Assorted Web Stuff
 
 
Copyright © 2000-2004, techtricks.com; All Rights Reserved.
Acknowledgements, Disclaimers, Terms and Conditions.
Article last updated on 11 December 2003

 

Other Sites: Paradox, Delphi, Perl, Web Stuff, and More


 

[- End -]