Solved

PageControl Sorting

Posted on 2003-12-05
2
311 Views
Last Modified: 2010-04-05
Anyone know how to sort tabs on a PageControl according to their captions, perhaps as alphabetically? Or if that's too hard of a question, how about if the tabs's captions are numbered and I want to sort them in ascending order?
0
Comment
Question by:Nailhead
2 Comments
 
LVL 8

Accepted Solution

by:
gmayo earned 140 total points
ID: 9884235
procedure TForm1.Button1Click(Sender: TObject);
var
      i : integer;
      reloop : boolean;
begin
      reloop := true;
      while reloop = true do begin
            reloop := false;
            for i := 0 to PageControl1.PageCount - 2 do begin
                  if PageControl1.Pages[i].Caption > PageControl1.Pages[i + 1].Caption then begin
                        PageControl1.Pages[i].PageIndex := i + 1;
                        reloop := true;
                  end;
            end;
      end;
end;

Works for text and numbers.

Geoff M.
0
 

Author Comment

by:Nailhead
ID: 9884517
Wow, worked like a charm! Thanks a million!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Intraweb submit form as a POST request 4 263
Internet Explorer View Settings Question 15 106
how to center only a line in richedit? 4 52
Dev Express grid collapse 2 39
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now