访问FMX样式对象的事件处理程序



如何访问样式按钮的事件处理程序。例如,这是有效的:

ListBoxItem.StylesData['detail2.text'] := date;

但不是这个:

ListBoxItem.StylesData['downloadbutton.OnClick'] := LoadFileContent; //says not enough parameters. So when I put in 'LoadFileContent(nil) then I get an imcompatible types error message

这应该做到:

uses
  //....
  System.Rtti;
  //....
  ListBoxItem.StylesData['downloadbutton.OnClick'] := TValue.From<TNotifyEvent>(LoadFileContent);

最新更新