【问题标题】:Get selected component in Fastreport editor?在 Fastreport 编辑器中获取选定的组件?
【发布时间】:2019-09-03 14:59:03
【问题描述】:

有什么方法可以获取用户在报告编辑器中选择的对象/组件?我的意思是,Delphi 应用程序有什么方法可以知道选择了哪个项目/对象/组件?

例如,如果我单击 TfrxMemoView 或 TfrxPictureView,我希望我的 Delphi 应用程序能够识别该对象,以便您可以使用它,就像这样......

myMemo := myDesigner.getSelected;

myMemo := myReport.getSelected;

我正在使用 FastReports VCL 6。

如果您知道如何实现,那将非常有帮助。

【问题讨论】:

    标签: delphi vcl fastreport


    【解决方案1】:

    好吧,如果您需要按照我的需要做同样的事情,我设法做到了:

    for I := 0 to Report.Designer.SelectedObjects.Count - 1 do
        begin
         ShowMessage(TfrxComponent(Report.Designer.SelectedObjects.Items[i]).Name);
          if TfrxComponent(Report.Designer.SelectedObjects.Items[i]) is TfrxMemoView then
           begin
             TfrxMemoView(Report.Designer.SelectedObjects.Items[i]).Align:= baLeft;
             Report.Designer.ReloadObjects();{to refresh the designer as it was embedded in a panel and I wanted to change components properties on "realtime"}
           end;
        end;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-04-09
      • 2014-07-22
      • 1970-01-01
      • 1970-01-01
      • 2017-10-27
      • 2012-05-14
      • 1970-01-01
      相关资源
      最近更新 更多