如何访问样式按钮的事件处理程序。例如,这有效:
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
答案 0 :(得分:4)
这应该这样做:
uses
//....
System.Rtti;
//....
ListBoxItem.StylesData['downloadbutton.OnClick'] := TValue.From<TNotifyEvent>(LoadFileContent);