type TForm1 = class(TForm) ... procedure MyOnClick(Sender : TObject); ... implementation ... NewButton.OnClick := MyOnClick;