Recent

Author Topic: Reordering worksheets  (Read 344 times)

Zoran

  • Hero Member
  • *****
  • Posts: 1459
    • http://wiki.lazarus.freepascal.org/User:Zoran
Reordering worksheets
« on: June 09, 2019, 10:52:47 pm »
Hello,

How can I programmatically move a worksheet to another position within a workbook?

I can't find any move method, or setting worksheet index, or similar; is there any way to reorder worksheets?

wp

  • Hero Member
  • *****
  • Posts: 6231
Re: Reordering worksheets
« Reply #1 on: June 10, 2019, 01:17:11 am »
In the new revision, TsWorksheet has a property Index which you can set to its new position in the workbook. Notification of the visual controls should work, i.e. the tabs of the TabControl will rearrange accordingly.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Zoran

  • Hero Member
  • *****
  • Posts: 1459
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Reordering worksheets
« Reply #2 on: June 11, 2019, 11:06:07 am »
It doesn't matter if a feature had existed or not before the question, when a library's maintainer is Werner.
It is enough to ask if some feature exists, you get the positive answer!
 :)

Thank you very much!