Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PageControl Sorting

Posted on 2003-12-05
2
Medium Priority
?
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
gmayo earned 560 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
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 this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

618 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