How To Read and Write Delphi 2010 RibbonApplicationMenuBar Recent Items To A File

∥☆過路亽.° 提交于 2020-01-06 02:51:30

问题


How do you read and write RibbonApplicationMenuBar recent items to a file or an INI file?

The help file is not very helpful for getting at the list of recent item strings to save and reload the recent items. I can add items to the recent items list by Ribbon1.AddRecentItem( APathFilename) and open the file associated with the recent item with the RecentItemClick event but I can not figure out how to save and reload recent filenames to the recent items list.


回答1:


The TRibbonApplicationMenuBar has a RecentItems property, which provides access to a list of each recent item.

// example code - untested.
RibbonApplicationMenuBar1.RecentItems.Items[1].Caption;

Another example for looping though each item.

// example code - untested.  
var
  count : Integer;
begin
  For count := 1 to RibbonApplicationMenuBar1.RecentItems.Items.Count do
  begin
    ShowMessage(RibbonApplicationMenuBar1.RecentItems.Items[count].Caption);
  end;
end;


来源:https://stackoverflow.com/questions/1402373/how-to-read-and-write-delphi-2010-ribbonapplicationmenubar-recent-items-to-a-fil

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!