Board index » cppbuilder » Setting OnEnter Event from ActiveControl

Setting OnEnter Event from ActiveControl

I have an OnExit event handler in which I would like to set the
OnEnter event handler for the component that will be getting
focus.  The ActiveControl property of the form is set to the
component that will be getting focus.  An assigment statement of
the form:
    ActiveControl->OnEnter = function;
is invalid.  What is the best way to set the OnEnter event
handler?
 

Re:Setting OnEnter Event from ActiveControl


OnEnter is an event of TWinControl.  ActiveControl is a TWinControl.  It
should work fine.  Please elaborate on what you mean by "is invalid"
exactly, along with a sample piece of code that demonstrates the problem.

Gambit

Quote
"Richard Casten" <richard.cas...@aero.org> wrote in message

news:3B291E57.15D3DD8B@aero.org...
Quote
>     ActiveControl->OnEnter = function;
> is invalid.  What is the best way to set the OnEnter event
> handler?

Re:Setting OnEnter Event from ActiveControl


The error message is:
  'TWinControl::OnEnter' is not accessible.
Quote
Remy Lebeau wrote:
> OnEnter is an event of TWinControl.  ActiveControl is a TWinControl.  It
> should work fine.  Please elaborate on what you mean by "is invalid"
> exactly, along with a sample piece of code that demonstrates the problem.

> Gambit

> "Richard Casten" <richard.cas...@aero.org> wrote in message
> news:3B291E57.15D3DD8B@aero.org...
> >     ActiveControl->OnEnter = function;
> > is invalid.  What is the best way to set the OnEnter event
> > handler?

Re:Setting OnEnter Event from ActiveControl


Ah, I see the delemna now.

You'll just have to cast ActiveControl to an object type where OnEnter is
exposed as public, before you can set it.

Gambit

Quote
"Richard Casten" <richard.cas...@aero.org> wrote in message

news:3B2A60C6.7F575880@aero.org...
Quote
> The error message is:
>   'TWinControl::OnEnter' is not accessible.

Other Threads