How to handle Onclick event

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
jasonz_2003
Posts: 24
Joined: 13 Apr 2006, 16:20

How to handle Onclick event

Post by jasonz_2003 » 27 Jun 2010, 02:21

Hi,

I have noticed that you use

Code: Select all

sgPaintBox->OnMouseUp = sgPaintBoxMouseUp;
to point to the event handler. But I can not use the same way for OnClick. Compiler error. Please guide what is the difference between the two events and how to write the handler for OnClick event.

support
Posts: 3256
Joined: 30 Mar 2005, 11:36
Contact:

Re: How to handle Onclick event

Post by support » 29 Jun 2010, 14:48

Hello.
Probably you're not realize the correspond event handler for OnClick event that is necessary to use event. You need define (in .h file) and write (in .cpp) event handler (void __fastcall):

Code: Select all

void __fastcall sgPaintBoxOnClick(TObject *Sender);

Code: Select all

void __fastcall TfmMain::sgPaintBoxOnClick(TObject *Sender)
{
	MessageBox(Handle, "Hello", "OnClick event handler", MB_ICONWARNING);
}
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply