Page 1 of 1

How to handle Onclick event

Posted: 27 Jun 2010, 02:21
by jasonz_2003
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.

Re: How to handle Onclick event

Posted: 29 Jun 2010, 14:48
by support
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.