Re: Event handlers...



swansnow wrote:
(Now that you know the terminology, does the error
message make a little more sense?)

Aha!  OK, now it makes sense! I thought the wording seemed a bit
peculiar... Can the event handler belong to a different class?

Yes. It frequently does. For instance, when you assign an event handler to a TButton's OnClick event, the method usually belongs to a form, not to the button.


What if I had a data module to hold event handlers that I wanted to use
across many classes (like validating alphanumeric keypresses, making
"enter" act like a "tab" (don't ask!), etc) Can I do something like
that?

The newsgroup archives should have *lots* of messages discussing how to make the Enter key behave like Tab. (I don't know how, off-hand, since I've never needed that.) In your search, you'll probably come across a link to an article at Borland's site.


As for ensuring that an edit box only accepts the characters you want, please refer to the following article.

http://groups.google.com/group/borland.public.delphi.vcl.components.writing/msg/41b62f85dd405cdf

--
Rob
.


Quantcast