Board index » delphi » D1: OnEnter & OnExit will not override

D1: OnEnter & OnExit will not override

I am writing a component that needs to be able to recieve focus, so I
made it descendant of TCustomControl. So far so good... Delphi
specifically states to do so if you need focus. It also states that
TCustomControl (or rather tWinControl) contains the protected method for
the OnEnter and OnExit events, which can (must) be overridden.

protected
  procedure Enter; override;
  procedure Exit; override;
  (more working overridden procedures...)

procedure TSlider.Enter;
begin
  inherited Enter;
  ...
end;

The compiler starts nagging in the protected section already, with a
message that these methods "don't exist in the base descendants", and
recommends to remove the override statement. This is complete and utter
bullshit because the help file said they DO exist! (In TWinControl no
less!)

if I remove the protected statement however, it start nagging in the
procedure itself, stating there is nothing to inherit from!

Anyone have any ideas how to solve this, I am getting slightly
frustrated here...

-- Erwin Dokter
   mailto:erwin.dok...@tip.nl
   http://www.tip.nl/users/erwin.dokter

 

Re:D1: OnEnter & OnExit will not override


I found another way of solving it (by peeking from the spin sample)

-- Erwin Dokter
   mailto:erwin.dok...@tip.nl
   http://www.tip.nl/users/erwin.dokter

Other Threads