Solved

PageControl Sorting

Posted on 2003-12-05
2
310 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How can I open IE in olecontainer? 7 108
Firewall issues 6 85
QRReport  TQrmemo vertical stretching 1 37
creating threads in delphi 1 53
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

707 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

14 Experts available now in Live!

Get 1:1 Help Now