2015-02-10 58 views
1

如何访问风格化按钮的事件处理程序。例如,这个工程:访问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 

回答

4

这应做到:

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