如何读取和写入 Delphi 2010 RibbonApplicationMenuBar 最近项目到文件 [英] How To Read and Write Delphi 2010 RibbonApplicationMenuBar Recent Items To A File

查看:44
本文介绍了如何读取和写入 Delphi 2010 RibbonApplicationMenuBar 最近项目到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您如何将 RibbonApplicationMenuBar 最近的项目读取和写入文件或 INI 文件?

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

帮助文件对于获取最近项目字符串列表以保存和重新加载最近项目不是很有帮助.我可以通过 Ribbon1.AddRecentItem(APathFilename) 将项目添加到最近项目列表,并使用 RecentItemClick 事件打开与最近项目关联的文件,但我不知道如何将最近的文件名保存并重新加载到最近的项目列表中.

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.

推荐答案

TRibbonApplicationMenuBar 有一个 RecentItems 属性,提供对 list 每个最近的项目.

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;

这篇关于如何读取和写入 Delphi 2010 RibbonApplicationMenuBar 最近项目到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆