In Codegear C++ Builder, I'm trying to extend the TMemo VCL class to perform some functionality during the OnKeyDown event. I've set up the control and am able to add it to forms and so forth. The problem is that I am unable to capture the OnKeyDown event (or any other event, for that matter).
Here is my class:
class PACKAGE TREMemoFind : public TMemo
{
private:
TFindDialog *FindDialog;
protected:
void __fastcall MemoKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
public:
__fastcall TREMemoFind(TComponent* Owner);
__published:
};
__fastcall TREMemoFind::TREMemoFind(TComponent* Owner) : TMemo(Owner)
{
ScrollBars = ssVertical;
OnKeyDown = MemoKeyDown;
}
void __fastcall TREMemoFind::MemoKeyDown(TObject *Sender, WORD &Key, TShiftState Shift)
{
ShowMessage("It worked!");
}
So, I guess my question is: how do I set up the classes that I derive from the VCL classes to perform custom functions when a certain event fires?