I have put images (TImage
) as buttons in my program. I want to add some extra effects, so in OnMouseMove
(whenever the user moves his mouse over the image) the image is replaced by another image in order to give the extra effect:
procedure TForm1.Image4MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
Path, Destination: String;
begin
Path := ParamStr(0);
Destination := Extractfilepath(Path) + 'Images\Image2.bmp';
Image4.Picture.LoadFromFile(Destination);
end;
But whenever the user moves his mouse away (when he leaves the image), it doesn't undo the things done (change back to Image1). How am I going to do that? There isn't a OnMouseLeave
event. I am using delphi 7.