Delphi/Lazarus: Change Order of TabSheets on PageControl at runtime
Tip by Delphian | Last update on 2023-12-03 | Created on 2013-10-29
Question: We have a TPageControl, on which there are positioned some TabSheets. At the start time of the program, those tabs have a specific arrangement and we would like to change this arrangement respectively the order of the tabs during the runtime of our program.
Solution: Via the property PageIndex, it is possible to determine and set the position of each TabSheet on a PageControl.
procedure TForm1.Button1Click(Sender: TObject); begin TabSheet3.PageIndex:=0; TabSheet2.PageIndex:=1; TabSheet1.PageIndex:=2; TabSheet0.PageIndex:=3; end;
In the example, the order of the TabSheets "TabSheet0" to "TabSheet3" is reversed, so that previously, "TabSheet0" is located at the first position and after running this code, "TabSheet3" is at the first position while "TabSheet0" is at the last position on the PageControl.
About the Author
The author has not added a profile short description yet.
Show Profile
Related Topics
Delphi/Lazarus: Create TabSheet on PageControl dynamically
Tutorial | 0 Comments
Delphi/Lazarus: Arrange PageControl-Tabs in multiple Rows
Question | 1 Answer
VirtualBox: Change Date and Time
Tutorial | 10 Comments
Delphi: Insert TabSheet at first position of PageControl
Question | 1 Answer
Delphi/Lazarus: Command Line Parameter Tutorial Part 1: Sending
Tutorial | 0 Comments
Delphi: Multiline Caption for TLabel (at Run Time and Design Time)
Tutorial | 1 Comment
Delphi/Lazarus: How to set up a Link to a Website in an Application
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.