I'm working on an application which dynamically allocates buttons as needed from a database column. Here's the deal, I create the buttons dynamically, but they need to be clickalbe. Some one was already kind enough to point out how to set the Onclick property of the buttons to a procedure. However, since my procedure my create multiple buttons each time it is called, it does so itteratively. So every button has the same properties,(excepting the positioning of the buttons via a accumulating offset value). Therefore I call the same OnClick procedure everytime I click one of my newly created buttons.
Since I want this application to be as generic as possible, I want to keep a singe onclick procdure, however, I'm having troubles. Since there are multiple buttons that could use the procedure, I need a way of distinguishing wich button called it. I though it would be a simple matter of passing a TButton Parameter to it. But the Onclick property of the buttons is of TNotifyEvent. And it won't let me(or at least I can't figure out how!) to pass additional paramaters, it only seems to work with (Sender: TObject). I thought maybe I'd have to derive my own handeler, I really have no Idea. Any help would be greatly appriciated as i'm new to delphi and struggling!
Thank you in Advance!