I have a form on which I want to place about 40 or 50 images. However, I want to create these images at run-time and I want to place them on the form at run-time. So for each of these images, I want to put up a messagebox (or something of that sort) whenever the user clicks on one of the images. I guess the crux of the matter is that I want to do all of this at run-time and not a design-time. So, I am confused on how to override the OnClick event of Timage for my new image type, TMyImage.
TMyImage = class(TImage)
procedure OnClick(Sender: TObject); override; { When I
put override here, it gives me an error }
private
public
end;
procedure TMyImage.OnClick(Sender: TObject); override; {Once again, an error }
And, of course, it doesn't work even if I replace override with virtual
or even if I don't put anything there.