2015-02-10 59 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); 
相關問題