Board index » cppbuilder » OnEnter/OnExit Events

OnEnter/OnExit Events

MyComponent was derived from TCustomEdit.

I have successfully created the following events:
KeyDown(), KeyPress() and Change()

I have also attempted to create Enter() and Exit() events
in the same manner.

However, although the program compiles with no errors or warnings,
neither of the Enter() or Exit() events seem to trigger.

How can I get these events to trigger?

Thanks
Ron

 

Re:OnEnter/OnExit Events


You need do override the DoEnter() and DoExit() methods instead:

    class TMyEdit : public TCustomEdit
    {
    protected:
        DYNAMIC void __fastcall DoEnter();
        DYNAMIC void __fastcall DoExit();
    };

    void __fastcall TMyEdit::DoEnter()
    {
        // do something
        TCustomEdit::DoEnter();
    }

    void __fastcall TMyEdit::DoExit()
    {
        // do something
        TCustomEdit::DoExit();
    }

Gambit

Quote
"Ron Siegel" <aronsie...@hotmail.com> wrote in message

news:3cb5d92f_1@dnews...
Quote
> I have also attempted to create Enter() and Exit() events
> in the same manner.

> However, although the program compiles with no errors or
> warnings, neither of the Enter() or Exit() events seem to trigger.

Other Threads