How do I specify a mouseDown eventhandler to dynaically creted Tpanels? My intention is to create a number of panels, like tiles, and move them around on the Form
I have created a design time TPanel and copied its OnMouseDown event and saved it as PanelMouseDown.
Pan:=TPanel.Create(Form2); Pan.Height:=60; Pan.Width:=60; Pan.Parent:=Form2; Pan.DragMode:=dmManual; Pan.OnMouseDown :=Form2.PanelMouseDown;
I cant get the panels to react on mouseclicks. Does somebody have any suggestions?