procedure TForm1.NewClick(Sender: TObject); begin ShowMessage(‘123‘); end;
procedure TForm1.Action1Execute(Sender: TObject); var M: TMethod; C: TLabel; begin // Setup OnExecute event // I really don‘t know how to convert an event (such as TNotifyEvent) to TMethod C := TLabel.Create(nil); try C.OnClick := NewClick; M := TMethod(C.OnClick); finally C.Free; end; FGroups[0].SetProperty(‘OnExecute‘, M); FGroups[0].SetProperty(‘Caption‘, ‘11‘);
// Get OnExecute from gruop 1 and set to group 4 FGroups[0].GetProperty(‘OnExecute‘, M); FGroups[3].SetProperty(‘OnExecute‘, M);
if FGroups[3].PropertyGrouped(‘Enabled‘) then ShowMessage(‘Group[3] ‘‘Enabled‘‘ property grouped‘); if not FGroups[3].PropertyGrouped(‘Enabled‘, False) then ShowMessage(‘Group[3] ‘‘Enabled‘‘ property not grouped to ‘‘False‘‘‘); if not FGroups[3].PropertyGrouped(‘Caption‘, ‘Action10‘) then ShowMessage(‘Group[3] ‘‘Caption‘‘ property not grouped to ‘‘Action10‘‘‘); end;
----------------------------------------------