[SOLVED] Erm ... TPageControl ... how do you swap pages? lazarus / 31-LCL ---------------------------------------------------------------------- EganSolo · 2025-06-17 03:20 This should be easy ... but since the Page[] and Pages[] properties are read-only, how do you swap two pages? I want to allow the user to move a page left, right etc. ---------------------------------------------------------------------- Awkward · 2025-06-17 04:16 try to use PageIndex and ActivePageIndex properties ---------------------------------------------------------------------- mtrsoft · 2025-06-17 05:02 Try using the TExtendedNotebook control (on the LazControls Tab). This is a TPageControl decscendant that enables dragging of the pagecontrols tabs. ---------------------------------------------------------------------- EganSolo · 2025-06-17 06:32 Awkward: Thanks for the suggestion! It turns out that the PageIndex property on the TabSheet works. It's important to note that it works like a move and not like a swap: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i //This code will NOT work. Swapping the indices returns you to the starting configuration.Procedure TMyClass.SwapPages(const Index1, Index2: Integer);var anIndex : integer;begin    with PageControl do    begin     anIndex := Pages[Index1].PageIndex;       Pages[Index1].PageIndex := Pages[Index2].PageIndex;       Pages[Index2].PageIndex := anIndex;   end;end;  This is the correct code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i //This code works.Procedure TMyClass.SwapPages(const Index1, Index2: Integer);var anIndex : integer;begin    with PageControl do    begin       anIndex := Pages[Index1].PageIndex;       //Pages[Index1].PageIndex := Pages[Index2].PageIndex;       Pages[Index2].PageIndex := anIndex;   end;end;  mtrSoft: Thanks for the suggestion. I switched the PageControl to the ExtendedNoteBook without a problem. If someone else wants to rely on this feature, don't forget to set TabDragMode and TabDragAcceptMode to dmAutomatic for the drag and drop to be initiated via the mouse. Thanks, guys! That was great.