Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnClick event for TJPEGImage

Status
Not open for further replies.

Dolli

Programmer
Jun 11, 2005
1
IS
Hi!
I need Onclic event for TJPEGImage. I have a constructor that creates tjpegimages and a procedure that adds them to tscrollbox. I need to be able to click on the image on the tscrollbox. I tried to use TControl with no luck. This is the code I used:

TControl = Class(TThumb)
Private
FOnClick: TNotifyEvent;
Protected
Procedure Click; dynamic;
Property OnClick:TNotifyEvent read FOnClick write FOnClick;
end;

and the click procedure:

procedure Tcontrol.Click;
begin
if Assigned(FonClick) then FonClick(Self);
end;

Help in code is good :,)
Hare is the constructor:

type TThumb = class(TGraphicControl)
fpics : TJPEGImage;
private
procedure getpic(value : tjpegimage);
public
procedure paint; override;
constructor create(aowner: TComponent); override;
destructor destroy; override;
published
property pic : tjpegimage write getpic;
end;

thanks!

 
You havnt actualy shown the constructer code just the definition.
The constructor should assign the onclick

onclick := click; // the onclick method

Steve: Delphi a feersum engin indeed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top